Skip to content

Commit f9d8cf0

Browse files
committed
Add nuw in GEP for CodeGenSYCL tests
Due to 94473f4 2024-08-09 [IRBuilder] Generate nuw GEPs for struct member accesses (#99538)
1 parent 0528965 commit f9d8cf0

17 files changed

+78
-78
lines changed

clang/test/CodeGenSYCL/accessor_inheritance.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,33 @@ int main() {
6060
// CHECK: store i32 [[ARG_C]], ptr addrspace(4) [[ARG_C]].addr.ascast
6161
//
6262
// Check A and B scalar fields initialization
63-
// CHECK: [[GEP:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
64-
// CHECK: [[FIELD_A:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 0
63+
// CHECK: [[GEP:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
64+
// CHECK: [[FIELD_A:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 0
6565
// CHECK: [[ARG_A_LOAD:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(4) [[ARG_A]].addr.ascast
6666
// CHECK: store i32 [[ARG_A_LOAD]], ptr addrspace(4) [[FIELD_A]]
67-
// CHECK: [[FIELD_B:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 1
67+
// CHECK: [[FIELD_B:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 1
6868
// CHECK: [[ARG_B_LOAD:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(4) [[ARG_B]].addr.ascast
6969
// CHECK: store i32 [[ARG_B_LOAD]], ptr addrspace(4) [[FIELD_B]]
7070
//
7171
// Check accessors initialization
72-
// CHECK: [[ACC_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 2
72+
// CHECK: [[ACC_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 2
7373
// Default constructor call
7474
// CHECK: call spir_func void @_ZN4sycl3_V18accessorIcLi1ELNS0_6access4modeE1024ELNS2_6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_listIJEEEEC1Ev(ptr addrspace(4) {{[^,]*}} [[ACC_FIELD]])
7575
// CHECK: [[GEP1:%[a-zA-Z0-9_]+]] = getelementptr inbounds i8, ptr addrspace(4) [[GEP]], i64 20
7676
// Default constructor call
7777
// CHECK: call spir_func void @_ZN4sycl3_V18accessorIcLi1ELNS0_6access4modeE1024ELNS2_6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_listIJEEEEC2Ev(ptr addrspace(4) {{[^,]*}} [[GEP1]])
7878

7979
// CHECK C field initialization
80-
// CHECK: [[FIELD_C:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Captured, ptr addrspace(4) [[GEP]], i32 0, i32 2
80+
// CHECK: [[FIELD_C:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Captured, ptr addrspace(4) [[GEP]], i32 0, i32 2
8181
// CHECK: [[ARG_C_LOAD:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(4) [[ARG_C]].addr.ascast
8282
// CHECK: store i32 [[ARG_C_LOAD]], ptr addrspace(4) [[FIELD_C]]
8383
//
8484
// Check __init method calls
85-
// CHECK: [[GEP2:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
86-
// CHECK: [[ACC1_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP2]], i32 0, i32 2
85+
// CHECK: [[GEP2:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
86+
// CHECK: [[ACC1_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP2]], i32 0, i32 2
8787
// CHECK: [[ACC1_DATA_LOAD:%[a-zA-Z0-9_]+]] = load ptr addrspace(1), ptr addrspace(4) [[ACC1_DATA]].addr.ascast
8888
// CHECK: call spir_func void @{{.*}}__init{{.*}}(ptr addrspace(4) {{[^,]*}} [[ACC1_FIELD]], ptr addrspace(1) noundef [[ACC1_DATA_LOAD]]
8989
//
90-
// CHECK: [[GEP3:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
90+
// CHECK: [[GEP3:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
9191
// CHECK: [[ACC2_DATA_LOAD:%[a-zA-Z0-9_]+]] = load ptr addrspace(1), ptr addrspace(4) [[ACC2_DATA]].addr.ascast
9292
// CHECK: call spir_func void @{{.*}}__init{{.*}}(ptr addrspace(4) {{[^,]*}}, ptr addrspace(1) noundef [[ACC2_DATA_LOAD]]

clang/test/CodeGenSYCL/address-space-new.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void test() {
6464
*aptr = 44;
6565
// CHECK: [[TMP13:%.*]] = load ptr addrspace(4), ptr addrspace(4) %aptr.ascast
6666
// CHECK: [[ARRAYDECAY2:%.*]] = getelementptr inbounds [42 x i32], ptr addrspace(4) [[ARR_ASCAST]], i64 0, i64 0
67-
// CHECK: [[ADD_PTR3:%.*]] = getelementptr inbounds i32, ptr addrspace(4) [[ARRAYDECAY2]], i64 168
67+
// CHECK: [[ADD_PTR3:%.*]] = getelementptr inbounds nuw i32, ptr addrspace(4) [[ARRAYDECAY2]], i64 168
6868
// CHECK: [[CMP4:%.*]] = icmp ult ptr addrspace(4) [[TMP13]], [[ADD_PTR3]]
6969

7070
const char *str = "Hello, world!";

clang/test/CodeGenSYCL/annotations-field.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ struct foo {
1919
int __attribute__((sycl_device)) foo() {
2020
struct foo f;
2121
f.v = 1;
22-
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 0
22+
// CHECK: getelementptr inbounds nuw %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 0
2323
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(1) null)
2424
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(1) null)
2525
f.w = 42;
26-
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 1
26+
// CHECK: getelementptr inbounds nuw %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 1
2727
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(1) null)
2828
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(1) null)
2929
f.f = 0;
30-
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 2
30+
// CHECK: getelementptr inbounds nuw %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 2
3131
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 16, ptr addrspace(1) null)
3232
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 16, ptr addrspace(1) null)
3333
return 0;

clang/test/CodeGenSYCL/basic-kernel-wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main() {
4444
// CHECK: call spir_func {{.*}}accessor
4545

4646
// Check accessor GEP
47-
// CHECK: [[ACCESSOR:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) [[ANON]], i32 0, i32 0
47+
// CHECK: [[ACCESSOR:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) [[ANON]], i32 0, i32 0
4848

4949
// Check load from kernel pointer argument alloca
5050
// CHECK: [[MEM_LOAD:%[a-zA-Z0-9_]+]] = load ptr addrspace(1), ptr addrspace(4) [[MEM_ARG]].addr.ascast

clang/test/CodeGenSYCL/debug-info-srcpos-kernel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main() {
2525
}
2626

2727
// CHECK: define{{.*}} spir_kernel {{.*}}19use_kernel_for_test({{.*}}){{.*}} !dbg [[KERNEL:![0-9]+]] {{.*}}{
28-
// CHECK: getelementptr inbounds %class.anon, {{.*}}, i32 0, i32 0, !dbg [[LINE_A0:![0-9]+]]
28+
// CHECK: getelementptr inbounds nuw %class.anon, {{.*}}, i32 0, i32 0, !dbg [[LINE_A0:![0-9]+]]
2929
// CHECK: call spir_func void {{.*}}6__init{{.*}} !dbg [[LINE_A0]]
3030
// CHECK: call spir_func void @_ZZ4mainENKUlvE_clEv{{.*}} !dbg [[LINE_B0:![0-9]+]]
3131
// CHECK: ret void, !dbg [[LINE_C0:![0-9]+]]

clang/test/CodeGenSYCL/device-variables.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ int main() {
3232
// CHECK: store i32 1, ptr addrspace(4) %b
3333
foo(local_value);
3434
// Local variables and constexprs captured by lambda
35-
// CHECK: [[GEP:%[a-z_]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 0
35+
// CHECK: [[GEP:%[a-z_]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 0
3636
// CHECK: call spir_func void @{{.*}}foo{{.*}}(ptr addrspace(4) noundef align 4 dereferenceable(4) [[GEP]])
3737
int some_device_local_var = some_local_var;
38-
// CHECK: [[GEP1:%[a-z_]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 1
38+
// CHECK: [[GEP1:%[a-z_]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 1
3939
// CHECK: [[LOAD1:%[0-9]+]] = load i32, ptr addrspace(4) [[GEP1]]
4040
// CHECK: store i32 [[LOAD1]], ptr addrspace(4) %some_device_local_var
4141
});

clang/test/CodeGenSYCL/generated-types-initialization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main() {
4848
// CHECK: %[[Arg_ref:[a-zA-Z0-9_.]+]] = addrspacecast ptr %_arg_Obj to ptr addrspace(4)
4949
//
5050
// Initialization.
51-
// CHECK: %[[GEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) %[[K_as_cast]], i32 0, i32 0
51+
// CHECK: %[[GEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) %[[K_as_cast]], i32 0, i32 0
5252
// CHECK: call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) align 8 %[[GEP]], ptr addrspace(4) align 8 %[[Arg_ref]], i64 16, i1 false)
5353
//
5454
// Kernel body call.
@@ -64,7 +64,7 @@ int main() {
6464
// CHECK: %[[NNSArg_ref:[a-zA-Z0-9_.]+]] = addrspacecast ptr %_arg_NNSObj to ptr addrspace(4)
6565
//
6666
// Initialization.
67-
// CHECK: %[[NNSGEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds %class.anon.2, ptr addrspace(4) %[[NNSK_as_cast]], i32 0, i32 0
67+
// CHECK: %[[NNSGEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds nuw %class.anon.2, ptr addrspace(4) %[[NNSK_as_cast]], i32 0, i32 0
6868
// CHECK: call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) align 8 %[[NNSGEP]], ptr addrspace(4) align 8 %[[NNSArg_ref]], i64 16, i1 false)
6969
//
7070
// Kernel body call.

clang/test/CodeGenSYCL/inheritance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ int main() {
7373
// CHECK: call void @llvm.memcpy.p4.p4.i64(ptr addrspace(4) align 8 %[[OFFSET_CALC]], ptr addrspace(4) align 8 %[[ARG_BASE1]], i64 24, i1 false)
7474

7575
// Initialize field 'a'
76-
// CHECK: %[[GEP_A:[a-zA-Z0-9]+]] = getelementptr inbounds %struct.derived, ptr addrspace(4) %[[LOCAL_OBJECT]], i32 0, i32 3
76+
// CHECK: %[[GEP_A:[a-zA-Z0-9]+]] = getelementptr inbounds nuw %struct.derived, ptr addrspace(4) %[[LOCAL_OBJECT]], i32 0, i32 3
7777
// CHECK: %[[LOAD_A:[0-9]+]] = load i32, ptr addrspace(4) %[[ARG_A]], align 4
7878
// CHECK: store i32 %[[LOAD_A]], ptr addrspace(4) %[[GEP_A]]
7979

clang/test/CodeGenSYCL/intel-fpga-ivdep-array.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ void ivdep_struct() {
185185
// CHECK: %[[STRUCT:[0-9a-z]+]] = alloca %struct.S
186186
[[intel::ivdep(s.arr, 5)]] for (int i = 0; i != 10; ++i)
187187
s.arr[i] = 0;
188-
// CHECK: %[[STRUCT_ARR:[0-9a-z]+]] = getelementptr inbounds %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 1
188+
// CHECK: %[[STRUCT_ARR:[0-9a-z]+]] = getelementptr inbounds nuw %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 1
189189
// CHECK: %{{[0-9a-z]+}} = getelementptr inbounds [10 x i32], ptr addrspace(4) %[[STRUCT_ARR]], i64 0, i64 %{{[0-9a-z]+}}, !llvm.index.group ![[IDX_GROUP_STRUCT_ARR:[0-9]+]]
190190
// CHECK: br label %for.cond, !llvm.loop ![[MD_LOOP_STRUCT_ARR:[0-9]+]]
191191

192192
[[intel::ivdep(s.ptr, 5)]] for (int i = 0; i != 10; ++i)
193193
s.ptr[i] = 0;
194-
// CHECK: %[[STRUCT_PTR:[0-9a-z]+]] = getelementptr inbounds %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 0
194+
// CHECK: %[[STRUCT_PTR:[0-9a-z]+]] = getelementptr inbounds nuw %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 0
195195
// CHECK: %[[LOAD_STRUCT_PTR:[0-9a-z]+]] = load ptr addrspace(4), ptr addrspace(4) %[[STRUCT_PTR]]
196196
// CHECK: %{{[0-9a-z]+}} = getelementptr inbounds i32, ptr addrspace(4) %[[LOAD_STRUCT_PTR]], i64 %{{[0-9a-z]+}}, !llvm.index.group ![[IDX_GROUP_STRUCT_PTR:[0-9]+]]
197197
// CHECK: br label %for.cond{{[0-9]*}}, !llvm.loop ![[MD_LOOP_STRUCT_PTR:[0-9]+]]

clang/test/CodeGenSYCL/intel-fpga-local.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,49 +118,49 @@ void attrs_on_struct() {
118118
int force_p2d [[intel::force_pow2_depth(1)]];
119119
} s;
120120

121-
// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
121+
// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
122122
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_NUMBANKS]]{{.*}}[[ANN_numbanks_4]]
123123
s.numbanks = 0;
124-
// CHECK-DEVICE: %[[FIELD_REGISTER:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
124+
// CHECK-DEVICE: %[[FIELD_REGISTER:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
125125
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_REGISTER]]{{.*}}[[ANN_register]]
126126
s.reg = 0;
127-
// CHECK-DEVICE: %[[FIELD_MEM_DEFAULT:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
127+
// CHECK-DEVICE: %[[FIELD_MEM_DEFAULT:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
128128
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MEM_DEFAULT]]{{.*}}[[ANN_memory_default]]
129129
s.memory = 0;
130-
// CHECK-DEVICE: %[[FIELD_MEM_BLOCKRAM:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
130+
// CHECK-DEVICE: %[[FIELD_MEM_BLOCKRAM:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
131131
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MEM_BLOCKRAM]]{{.*}}[[ANN_memory_blockram]]
132132
s.memory_blockram = 0;
133-
// CHECK-DEVICE: %[[FIELD_MEM_MLAB:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
133+
// CHECK-DEVICE: %[[FIELD_MEM_MLAB:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
134134
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MEM_MLAB]]{{.*}}[[ANN_memory_mlab]]
135135
s.memory_mlab = 0;
136-
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
136+
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
137137
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKWIDTH]]{{.*}}[[ANN_bankwidth_4]]
138138
s.bankwidth = 0;
139-
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
139+
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
140140
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_PRIV_COPIES]]{{.*}}[[ANN_private_copies_8]]
141141
s.privatecopies = 0;
142-
// CHECK-DEVICE: %[[FIELD_SINGLEPUMP:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
142+
// CHECK-DEVICE: %[[FIELD_SINGLEPUMP:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
143143
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_SINGLEPUMP]]{{.*}}[[ANN_singlepump]]
144144
s.singlepump = 0;
145-
// CHECK-DEVICE: %[[FIELD_DOUBLEPUMP:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
145+
// CHECK-DEVICE: %[[FIELD_DOUBLEPUMP:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
146146
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_DOUBLEPUMP]]{{.*}}[[ANN_doublepump]]
147147
s.doublepump = 0;
148-
// CHECK-DEVICE: %[[FIELD_MERGE_DEPTH:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
148+
// CHECK-DEVICE: %[[FIELD_MERGE_DEPTH:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
149149
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MERGE_DEPTH]]{{.*}}[[ANN_merge_depth]]
150150
s.merge_depth = 0;
151-
// CHECK-DEVICE: %[[FIELD_MERGE_WIDTH:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
151+
// CHECK-DEVICE: %[[FIELD_MERGE_WIDTH:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
152152
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MERGE_WIDTH]]{{.*}}[[ANN_merge_width]]
153153
s.merge_width = 0;
154-
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
154+
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
155155
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MAX_REPLICATES]]{{.*}}[[ANN_max_replicates_2]]
156156
s.maxreplicates = 0;
157-
// CHECK-DEVICE: %[[FIELD_DUALPORT:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
157+
// CHECK-DEVICE: %[[FIELD_DUALPORT:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
158158
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_DUALPORT]]{{.*}}[[ANN_simple_dual_port]]
159159
s.dualport = 0;
160-
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
160+
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
161161
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKBITS]]{{.*}}[[ANN_bankbits_4_5]]
162162
s.bankbits = 0;
163-
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
163+
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
164164
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_FP2D]]{{.*}}[[ANN_force_pow2_depth_1]]
165165
s.force_p2d = 0;
166166
}
@@ -198,22 +198,22 @@ void attrs_with_template_param() {
198198
int force_p2d [[intel::force_pow2_depth(C)]];
199199
} s;
200200

201-
// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
201+
// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
202202
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_NUMBANKS]]{{.*}}[[ANN_numbanks_4]]
203203
s.numbanks = 0;
204-
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
204+
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
205205
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKWIDTH]]{{.*}}[[ANN_bankwidth_4]]
206206
s.bankwidth = 0;
207-
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
207+
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
208208
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_PRIV_COPIES]]{{.*}}[[ANN_private_copies_4]]
209209
s.privatecopies = 0;
210-
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
210+
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
211211
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MAX_REPLICATES]]{{.*}}[[ANN_max_replicates_4]]
212212
s.maxreplicates = 0;
213-
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
213+
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
214214
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKBITS]]{{.*}}[[ANN_bankbits_4_5]]
215215
s.bankbits = 0;
216-
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
216+
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
217217
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_FP2D]]{{.*}}[[ANN_force_pow2_depth_1]]
218218
s.force_p2d = 0;
219219
}
@@ -231,7 +231,7 @@ void field_addrspace_cast() {
231231
}
232232
} state_var;
233233
// CHECK-DEVICE: define internal {{.*}} @_ZZ20field_addrspace_castvEN5stateC2Ev
234-
// CHECK-DEVICE: %[[MEM:[a-zA-Z0-9]+]] = getelementptr inbounds %{{.*}}, ptr addrspace(4) %{{.*}}, i32 0, i32 0
234+
// CHECK-DEVICE: %[[MEM:[a-zA-Z0-9]+]] = getelementptr inbounds nuw %{{.*}}, ptr addrspace(4) %{{.*}}, i32 0, i32 0
235235
// CHECK-DEVICE: %[[ANN:[0-9]+]] = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %[[MEM]], {{.*}}, {{.*}})
236236
state_var.mem[0] = 42;
237237
}

0 commit comments

Comments
 (0)