1. 09 8月, 2023 2 次提交
  2. 07 8月, 2023 3 次提交
  3. 06 8月, 2023 1 次提交
  4. 05 8月, 2023 2 次提交
  5. 03 8月, 2023 1 次提交
  6. 02 8月, 2023 1 次提交
  7. 30 7月, 2023 2 次提交
  8. 24 7月, 2023 4 次提交
  9. 22 7月, 2023 6 次提交
  10. 18 7月, 2023 1 次提交
  11. 17 7月, 2023 1 次提交
  12. 16 7月, 2023 2 次提交
  13. 15 7月, 2023 1 次提交
    • B
      Auto merge of #112157 - erikdesjardins:align, r=nikic · 4f16abdf
      bors 提交于
      Resurrect: rustc_target: Add alignment to indirectly-passed by-value types, correcting the alignment of byval on x86 in the process.
      
      Same as #111551, which I [accidentally closed](https://github.com/rust-lang/rust/pull/111551#issuecomment-1571222612) :/
      
      ---
      
      This resurrects PR #103830, which has sat idle for a while.
      
      Beyond #103830, this also:
      - fixes byval alignment for types containing vectors on Darwin (see `tests/codegen/align-byval-vector.rs`)
      - fixes byval alignment for overaligned types on x86 Windows (see `tests/codegen/align-byval.rs`)
      - fixes ABI for types with 128bit requested alignment on ARM64 Linux (see `tests/codegen/aarch64-struct-align-128.rs`)
      
      r? `@nikic`
      
      ---
      
      `@pcwalton's` original PR description is reproduced below:
      
      Commit 88e4d2c2 from five years ago removed
      support for alignment on indirectly-passed arguments because of problems with
      the `i686-pc-windows-msvc` target. Unfortunately, the `memcpy` optimizations I
      recently added to LLVM 16 depend on this to forward `memcpy`s. This commit
      attempts to fix the problems with `byval` parameters on that target and now
      correctly adds the `align` attribute.
      
      The problem is summarized in [this comment] by `@EddyB.` Briefly, 32-bit x86 has
      special alignment rules for `byval` parameters: for the most part, their
      alignment is forced to 4. This is not well-documented anywhere but in the Clang
      source. I looked at the logic in Clang `TargetInfo.cpp` and tried to replicate
      it here. The relevant methods in that file are
      `X86_32ABIInfo::getIndirectResult()` and
      `X86_32ABIInfo::getTypeStackAlignInBytes()`. The `align` parameter attribute
      for `byval` parameters in LLVM must match the platform ABI, or miscompilations
      will occur. Note that this doesn't use the approach suggested by eddyb, because
      I felt it was overkill to store the alignment in `on_stack` when special
      handling is really only needed for 32-bit x86.
      
      As a side effect, this should fix #80127, because it will make the `align`
      parameter attribute for `byval` parameters match the platform ABI on LLVM
      x86-64.
      
      [this comment]: #80822 (comment)
      4f16abdf
  14. 14 7月, 2023 1 次提交
  15. 13 7月, 2023 5 次提交
  16. 12 7月, 2023 3 次提交
  17. 11 7月, 2023 3 次提交
  18. 08 7月, 2023 1 次提交