================
@@ -73,7 +73,7 @@ void cbstructs() {
use(s1.a1);
// CHECK: load <3 x i16>, ptr addrspace(2) getelementptr inbounds nuw (%B,
ptr addrspace(2) @s2, i32 0, i32 1), align 2
use(s2.b1);
- // CHECK: load <2 x float>, ptr addrspace(2) getelementptr inbounds nuw (%C,
ptr addrspace(2) @s3, i32 0, i32 1), align 8
+ // CHECK: load <2 x float>, ptr addrspace(2) getelementptr inbounds nuw (%C,
ptr addrspace(2) @s3, i32 0, i32 2), align 8
----------------
bogner wrote:
We have:
```c++
struct A {
float2 a1;
};
struct C {
int c1;
A c2;
};
```
So there will be 12 bytes of padding after `c1`, which is member `1` of the
layout struct at `@s3`. Thus, `2` is needed to access `s3.c2`.
https://github.com/llvm/llvm-project/pull/179768
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits