Skip to content

Commit

Permalink
Add nuw in GEP for CodeGenSYCL tests
Browse files Browse the repository at this point in the history
Due to 94473f4 2024-08-09 [IRBuilder] Generate nuw GEPs for struct
member accesses (#99538)
  • Loading branch information
jsji committed Sep 6, 2024
1 parent c7291e6 commit a6f809d
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 78 deletions.
16 changes: 8 additions & 8 deletions clang/test/CodeGenSYCL/accessor_inheritance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,33 @@ int main() {
// CHECK: store i32 [[ARG_C]], ptr addrspace(4) [[ARG_C]].addr.ascast
//
// Check A and B scalar fields initialization
// CHECK: [[GEP:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
// CHECK: [[FIELD_A:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 0
// CHECK: [[GEP:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
// CHECK: [[FIELD_A:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 0
// CHECK: [[ARG_A_LOAD:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(4) [[ARG_A]].addr.ascast
// CHECK: store i32 [[ARG_A_LOAD]], ptr addrspace(4) [[FIELD_A]]
// CHECK: [[FIELD_B:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 1
// CHECK: [[FIELD_B:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 1
// CHECK: [[ARG_B_LOAD:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(4) [[ARG_B]].addr.ascast
// CHECK: store i32 [[ARG_B_LOAD]], ptr addrspace(4) [[FIELD_B]]
//
// Check accessors initialization
// CHECK: [[ACC_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 2
// CHECK: [[ACC_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP]], i32 0, i32 2
// Default constructor call
// CHECK: call spir_func void @_ZN4sycl3_V18accessorIcLi1ELNS0_6access4modeE1024ELNS2_6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_listIJEEEEC1Ev(ptr addrspace(4) {{[^,]*}} [[ACC_FIELD]])
// CHECK: [[GEP1:%[a-zA-Z0-9_]+]] = getelementptr inbounds i8, ptr addrspace(4) [[GEP]], i64 20
// Default constructor call
// CHECK: call spir_func void @_ZN4sycl3_V18accessorIcLi1ELNS0_6access4modeE1024ELNS2_6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_listIJEEEEC2Ev(ptr addrspace(4) {{[^,]*}} [[GEP1]])

// CHECK C field initialization
// CHECK: [[FIELD_C:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Captured, ptr addrspace(4) [[GEP]], i32 0, i32 2
// CHECK: [[FIELD_C:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Captured, ptr addrspace(4) [[GEP]], i32 0, i32 2
// CHECK: [[ARG_C_LOAD:%[a-zA-Z0-9_]+]] = load i32, ptr addrspace(4) [[ARG_C]].addr.ascast
// CHECK: store i32 [[ARG_C_LOAD]], ptr addrspace(4) [[FIELD_C]]
//
// Check __init method calls
// CHECK: [[GEP2:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
// CHECK: [[ACC1_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds %struct{{.*}}Base, ptr addrspace(4) [[GEP2]], i32 0, i32 2
// CHECK: [[GEP2:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
// CHECK: [[ACC1_FIELD:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %struct{{.*}}Base, ptr addrspace(4) [[GEP2]], i32 0, i32 2
// CHECK: [[ACC1_DATA_LOAD:%[a-zA-Z0-9_]+]] = load ptr addrspace(1), ptr addrspace(4) [[ACC1_DATA]].addr.ascast
// CHECK: call spir_func void @{{.*}}__init{{.*}}(ptr addrspace(4) {{[^,]*}} [[ACC1_FIELD]], ptr addrspace(1) noundef [[ACC1_DATA_LOAD]]
//
// CHECK: [[GEP3:%[a-zA-Z0-9_]+]] = getelementptr inbounds %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
// CHECK: [[GEP3:%[a-zA-Z0-9_]+]] = getelementptr inbounds nuw %class{{.*}}.anon, ptr addrspace(4) [[KERNEL_OBJ]], i32 0, i32 0
// CHECK: [[ACC2_DATA_LOAD:%[a-zA-Z0-9_]+]] = load ptr addrspace(1), ptr addrspace(4) [[ACC2_DATA]].addr.ascast
// CHECK: call spir_func void @{{.*}}__init{{.*}}(ptr addrspace(4) {{[^,]*}}, ptr addrspace(1) noundef [[ACC2_DATA_LOAD]]
2 changes: 1 addition & 1 deletion clang/test/CodeGenSYCL/address-space-new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void test() {
*aptr = 44;
// CHECK: [[TMP13:%.*]] = load ptr addrspace(4), ptr addrspace(4) %aptr.ascast
// CHECK: [[ARRAYDECAY2:%.*]] = getelementptr inbounds [42 x i32], ptr addrspace(4) [[ARR_ASCAST]], i64 0, i64 0
// CHECK: [[ADD_PTR3:%.*]] = getelementptr inbounds i32, ptr addrspace(4) [[ARRAYDECAY2]], i64 168
// CHECK: [[ADD_PTR3:%.*]] = getelementptr inbounds nuw i32, ptr addrspace(4) [[ARRAYDECAY2]], i64 168
// CHECK: [[CMP4:%.*]] = icmp ult ptr addrspace(4) [[TMP13]], [[ADD_PTR3]]

const char *str = "Hello, world!";
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGenSYCL/annotations-field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ struct foo {
int __attribute__((sycl_device)) foo() {
struct foo f;
f.v = 1;
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 0
// CHECK: getelementptr inbounds nuw %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 0
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(1) null)
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(1) null)
f.w = 42;
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 1
// CHECK: getelementptr inbounds nuw %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 1
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(1) null)
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(1) null)
f.f = 0;
// CHECK: getelementptr inbounds %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 2
// CHECK: getelementptr inbounds nuw %struct.foo, ptr addrspace(4) %{{.*}}, i32 0, i32 2
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 16, ptr addrspace(1) null)
// CHECK-NEXT: call ptr addrspace(4) @llvm.ptr.annotation.p4.p1({{.*}}str{{.*}}str{{.*}}i32 16, ptr addrspace(1) null)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenSYCL/basic-kernel-wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main() {
// CHECK: call spir_func {{.*}}accessor

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

// Check load from kernel pointer argument alloca
// CHECK: [[MEM_LOAD:%[a-zA-Z0-9_]+]] = load ptr addrspace(1), ptr addrspace(4) [[MEM_ARG]].addr.ascast
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenSYCL/debug-info-srcpos-kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main() {
}

// CHECK: define{{.*}} spir_kernel {{.*}}19use_kernel_for_test({{.*}}){{.*}} !dbg [[KERNEL:![0-9]+]] {{.*}}{
// CHECK: getelementptr inbounds %class.anon, {{.*}}, i32 0, i32 0, !dbg [[LINE_A0:![0-9]+]]
// CHECK: getelementptr inbounds nuw %class.anon, {{.*}}, i32 0, i32 0, !dbg [[LINE_A0:![0-9]+]]
// CHECK: call spir_func void {{.*}}6__init{{.*}} !dbg [[LINE_A0]]
// CHECK: call spir_func void @_ZZ4mainENKUlvE_clEv{{.*}} !dbg [[LINE_B0:![0-9]+]]
// CHECK: ret void, !dbg [[LINE_C0:![0-9]+]]
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenSYCL/device-variables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ int main() {
// CHECK: store i32 1, ptr addrspace(4) %b
foo(local_value);
// Local variables and constexprs captured by lambda
// CHECK: [[GEP:%[a-z_]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 0
// CHECK: [[GEP:%[a-z_]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 0
// CHECK: call spir_func void @{{.*}}foo{{.*}}(ptr addrspace(4) noundef align 4 dereferenceable(4) [[GEP]])
int some_device_local_var = some_local_var;
// CHECK: [[GEP1:%[a-z_]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 1
// CHECK: [[GEP1:%[a-z_]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) %{{.*}}, i32 0, i32 1
// CHECK: [[LOAD1:%[0-9]+]] = load i32, ptr addrspace(4) [[GEP1]]
// CHECK: store i32 [[LOAD1]], ptr addrspace(4) %some_device_local_var
});
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGenSYCL/generated-types-initialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int main() {
// CHECK: %[[Arg_ref:[a-zA-Z0-9_.]+]] = addrspacecast ptr %_arg_Obj to ptr addrspace(4)
//
// Initialization.
// CHECK: %[[GEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds %class.anon, ptr addrspace(4) %[[K_as_cast]], i32 0, i32 0
// CHECK: %[[GEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds nuw %class.anon, ptr addrspace(4) %[[K_as_cast]], i32 0, i32 0
// 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)
//
// Kernel body call.
Expand All @@ -64,7 +64,7 @@ int main() {
// CHECK: %[[NNSArg_ref:[a-zA-Z0-9_.]+]] = addrspacecast ptr %_arg_NNSObj to ptr addrspace(4)
//
// Initialization.
// CHECK: %[[NNSGEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds %class.anon.2, ptr addrspace(4) %[[NNSK_as_cast]], i32 0, i32 0
// CHECK: %[[NNSGEP:[a-zA-Z0-9_.]+]] = getelementptr inbounds nuw %class.anon.2, ptr addrspace(4) %[[NNSK_as_cast]], i32 0, i32 0
// 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)
//
// Kernel body call.
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenSYCL/inheritance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main() {
// 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)

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

4 changes: 2 additions & 2 deletions clang/test/CodeGenSYCL/intel-fpga-ivdep-array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ void ivdep_struct() {
// CHECK: %[[STRUCT:[0-9a-z]+]] = alloca %struct.S
[[intel::ivdep(s.arr, 5)]] for (int i = 0; i != 10; ++i)
s.arr[i] = 0;
// CHECK: %[[STRUCT_ARR:[0-9a-z]+]] = getelementptr inbounds %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 1
// CHECK: %[[STRUCT_ARR:[0-9a-z]+]] = getelementptr inbounds nuw %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 1
// 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]+]]
// CHECK: br label %for.cond, !llvm.loop ![[MD_LOOP_STRUCT_ARR:[0-9]+]]

[[intel::ivdep(s.ptr, 5)]] for (int i = 0; i != 10; ++i)
s.ptr[i] = 0;
// CHECK: %[[STRUCT_PTR:[0-9a-z]+]] = getelementptr inbounds %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 0
// CHECK: %[[STRUCT_PTR:[0-9a-z]+]] = getelementptr inbounds nuw %struct.S, ptr addrspace(4) %[[STRUCT]].ascast, i32 0, i32 0
// CHECK: %[[LOAD_STRUCT_PTR:[0-9a-z]+]] = load ptr addrspace(4), ptr addrspace(4) %[[STRUCT_PTR]]
// 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]+]]
// CHECK: br label %for.cond{{[0-9]*}}, !llvm.loop ![[MD_LOOP_STRUCT_PTR:[0-9]+]]
Expand Down
44 changes: 22 additions & 22 deletions clang/test/CodeGenSYCL/intel-fpga-local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,49 +118,49 @@ void attrs_on_struct() {
int force_p2d [[intel::force_pow2_depth(1)]];
} s;

// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_NUMBANKS]]{{.*}}[[ANN_numbanks_4]]
s.numbanks = 0;
// CHECK-DEVICE: %[[FIELD_REGISTER:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_REGISTER:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_REGISTER]]{{.*}}[[ANN_register]]
s.reg = 0;
// CHECK-DEVICE: %[[FIELD_MEM_DEFAULT:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_MEM_DEFAULT:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MEM_DEFAULT]]{{.*}}[[ANN_memory_default]]
s.memory = 0;
// CHECK-DEVICE: %[[FIELD_MEM_BLOCKRAM:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_MEM_BLOCKRAM:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MEM_BLOCKRAM]]{{.*}}[[ANN_memory_blockram]]
s.memory_blockram = 0;
// CHECK-DEVICE: %[[FIELD_MEM_MLAB:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_MEM_MLAB:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MEM_MLAB]]{{.*}}[[ANN_memory_mlab]]
s.memory_mlab = 0;
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKWIDTH]]{{.*}}[[ANN_bankwidth_4]]
s.bankwidth = 0;
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_PRIV_COPIES]]{{.*}}[[ANN_private_copies_8]]
s.privatecopies = 0;
// CHECK-DEVICE: %[[FIELD_SINGLEPUMP:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_SINGLEPUMP:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_SINGLEPUMP]]{{.*}}[[ANN_singlepump]]
s.singlepump = 0;
// CHECK-DEVICE: %[[FIELD_DOUBLEPUMP:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_DOUBLEPUMP:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_DOUBLEPUMP]]{{.*}}[[ANN_doublepump]]
s.doublepump = 0;
// CHECK-DEVICE: %[[FIELD_MERGE_DEPTH:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_MERGE_DEPTH:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MERGE_DEPTH]]{{.*}}[[ANN_merge_depth]]
s.merge_depth = 0;
// CHECK-DEVICE: %[[FIELD_MERGE_WIDTH:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_MERGE_WIDTH:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MERGE_WIDTH]]{{.*}}[[ANN_merge_width]]
s.merge_width = 0;
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MAX_REPLICATES]]{{.*}}[[ANN_max_replicates_2]]
s.maxreplicates = 0;
// CHECK-DEVICE: %[[FIELD_DUALPORT:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_DUALPORT:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_DUALPORT]]{{.*}}[[ANN_simple_dual_port]]
s.dualport = 0;
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKBITS]]{{.*}}[[ANN_bankbits_4_5]]
s.bankbits = 0;
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds nuw %struct.attrs_on_struct{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_FP2D]]{{.*}}[[ANN_force_pow2_depth_1]]
s.force_p2d = 0;
}
Expand Down Expand Up @@ -198,22 +198,22 @@ void attrs_with_template_param() {
int force_p2d [[intel::force_pow2_depth(C)]];
} s;

// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: %[[FIELD_NUMBANKS:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_NUMBANKS]]{{.*}}[[ANN_numbanks_4]]
s.numbanks = 0;
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: %[[FIELD_BANKWIDTH:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKWIDTH]]{{.*}}[[ANN_bankwidth_4]]
s.bankwidth = 0;
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: %[[FIELD_PRIV_COPIES:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_PRIV_COPIES]]{{.*}}[[ANN_private_copies_4]]
s.privatecopies = 0;
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: %[[FIELD_MAX_REPLICATES:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_MAX_REPLICATES]]{{.*}}[[ANN_max_replicates_4]]
s.maxreplicates = 0;
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: %[[FIELD_BANKBITS:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_BANKBITS]]{{.*}}[[ANN_bankbits_4_5]]
s.bankbits = 0;
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: %[[FIELD_FP2D:.*]] = getelementptr inbounds nuw %struct.templ_on_struct_fields{{.*}}
// CHECK-DEVICE: call ptr addrspace(4) @llvm.ptr.annotation.p4{{.*}}%[[FIELD_FP2D]]{{.*}}[[ANN_force_pow2_depth_1]]
s.force_p2d = 0;
}
Expand All @@ -231,7 +231,7 @@ void field_addrspace_cast() {
}
} state_var;
// CHECK-DEVICE: define internal {{.*}} @_ZZ20field_addrspace_castvEN5stateC2Ev
// CHECK-DEVICE: %[[MEM:[a-zA-Z0-9]+]] = getelementptr inbounds %{{.*}}, ptr addrspace(4) %{{.*}}, i32 0, i32 0
// CHECK-DEVICE: %[[MEM:[a-zA-Z0-9]+]] = getelementptr inbounds nuw %{{.*}}, ptr addrspace(4) %{{.*}}, i32 0, i32 0
// CHECK-DEVICE: %[[ANN:[0-9]+]] = call ptr addrspace(4) @llvm.ptr.annotation.p4.p1(ptr addrspace(4) %[[MEM]], {{.*}}, {{.*}})
state_var.mem[0] = 42;
}
Expand Down
Loading

0 comments on commit a6f809d

Please sign in to comment.