clang ABI lowering should not turn FP + int structs into integer arrays for AMDGPU
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Clang chooses to represent a struct containing a float and an int as an integer array: https://godbolt.org/z/sjafTqbq3
```c++
// clang -target amdgcn-amd-amdhsa -S -emit-llvm -o - -nogpulib -nogpuinc %s
typedef struct fp_int_pair {
float f;
int i;
} fp_int_pair;
fp_int_pair foo(fp_int_pair x) {
return x;
}
// Should emit { float, i32 }
//define hidden [2 x i32] @foo([2 x i32] returned %x.coerce) local_unnamed_addr #0 {
//entry:
// ret [2 x i32] %x.coerce
//}
```
There's no benefit to turning this into an integer array. If we had proper multiple return values, we would need this represented as the two types to attach nofpclass to the float component.
Contributor guide
Assessment
This issue has not been assessed yet.