[clang] [CodeGen] Add TBAA struct path info for array members (PR #137719)
Bruno De Fraine via cfe-commits
cfe-commits at lists.llvm.org
Wed May 21 14:33:53 PDT 2025
================
@@ -28,25 +30,39 @@ int bar(C *c) {
int bar2(C *c) {
// CHECK-NEW-LABEL: _Z4bar2P1C
-// CHECK-NEW: load i32, {{.*}}, !tbaa [[TAG_int:!.*]]
+// CHECK-NEW: load i32, {{.*}}, !tbaa [[TAG_C_x:!.*]]
return c->x[2];
}
int bar3(C *c, int j) {
// CHECK-NEW-LABEL: _Z4bar3P1Ci
-// CHECK-NEW: load i32, {{.*}}, !tbaa [[TAG_int:!.*]]
+// CHECK-NEW: load i32, {{.*}}, !tbaa [[TAG_C_x]]
return c->x[j];
----------------
brunodf-snps wrote:
Yes, the access to any element of the x member array will get this tag.
https://github.com/llvm/llvm-project/pull/137719
More information about the cfe-commits
mailing list