1
Fork 0
rust/compiler/rustc_target/src
Matthias Krüger 713c852a2f
Rollup merge of #117671 - kjetilkjeka:nvptx_c_abi_avoid_direct, r=davidtwco
NVPTX: Avoid PassMode::Direct for args in C abi

Fixes #117480

I must admit that I'm confused about `PassMode` altogether, is there a good sum-up threads for this anywhere? I'm especially confused about how "indirect" and "byval" goes together. To me it seems like "indirect" basically means "use a indirection through a pointer", while "byval" basically means "do not use indirection through a pointer".

The return used to keep `PassMode::Direct` for small aggregates. It turns out that `make_indirect` messes up the tests and one way to fix it is to keep `PassMode::Direct` for all aggregates. I have mostly seen this PassMode mentioned for args. Is it also a problem for returns? When experimenting with `byval` as an alternative i ran into [this assert](61a3eea804/compiler/rustc_codegen_llvm/src/abi.rs (L463C22-L463C22))

I have added tests for the same kind of types that is already tested for the "ptx-kernel" abi. The tests cannot be enabled until something like #117458 is completed and merged.

CC: ``@RalfJung`` since you seem to be the expert on this and have already helped me out tremendously

CC: ``@RDambrosio016`` in case this influence your work on `rustc_codegen_nvvm`

``@rustbot`` label +O-NVPTX
2024-05-28 18:04:31 +02:00
..
abi Rollup merge of #117671 - kjetilkjeka:nvptx_c_abi_avoid_direct, r=davidtwco 2024-05-28 18:04:31 +02:00
asm Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
spec Auto merge of #124676 - djkoloski:relax_multiple_sanitizers, r=cuviper,rcvalle 2024-05-21 15:35:29 +00:00
json.rs Add metadata to targets 2024-03-10 20:46:08 +01:00
lib.rs Remove unused step_trait feature. 2024-05-08 11:00:19 +10:00
target_features.rs Stop using the avx512er and avx512pf x86 target features 2024-05-24 20:12:42 +02:00
tests.rs Use serde_json for target spec json 2022-06-03 16:46:19 +00:00