llvm-project
b226c304 - [CIR] Flatten one-field structs in CallConvLowering (#241190)

Commit
6 days ago
[CIR] Flatten one-field structs in CallConvLowering (#241190) Summary: - On AMDGPU, struct whose only field is an aggregate such as `struct { int V[4]; }` is passed as that field. - OGCG gives `[4 x i32]`. Example: [func_single_array_element_struct_arg](https://github.com/llvm/llvm-project/blob/7d25e4f9cd72686727beaf0b661ce3e910ee1349/clang/test/CodeGenOpenCL/amdgpu-abi-struct-coerce.cl#L309) test in `amdgpu-abi-struct-coerce.cl`. - CIR passed the whole struct, because `getFlattenedCoercedType` in `CIRABIRewriteContext` skipped struct with one field. - This patch lets the rewriter flatten struct with one field. Returns are not flattened as in OGCG. Related to issue: https://github.com/llvm/llvm-project/issues/220471 Assisted by: claude opus 5.5
Author
Parents
Loading