Skip to content

Commit a451a29

Browse files
committed
[CodeGen][OpenMP] Add alignment to test (NFC)
Check which alignments are generated for loads and stores.
1 parent 27f6cee commit a451a29

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

clang/test/OpenMP/task_codegen.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,87 +32,87 @@ int main(void) {
3232
// CHECK: [[ALLOC:%.+]] = call i8* @__kmpc_omp_task_alloc(%struct.ident_t* @{{.+}}, i32 [[GTID]], i32 65, i64 48, i64 0, i32 (i32, i8*)* bitcast (i32 (i32, [[PRIVATES_TY:%.+]]*)* [[TASK_ENTRY:@.+]] to i32 (i32, i8*)*))
3333
// CHECK: [[EVT_VAL:%.+]] = call i8* @__kmpc_task_allow_completion_event(%struct.ident_t* @{{.+}}, i32 [[GTID]], i8* [[ALLOC]])
3434
// CHECK: [[CAST_EVT_VAL:%.+]] = ptrtoint i8* [[EVT_VAL]] to i64
35-
// CHECK: store i64 [[CAST_EVT_VAL]], i64* [[EVT_ADDR]],
35+
// CHECK: store i64 [[CAST_EVT_VAL]], i64* [[EVT_ADDR]], align 8
3636
// CHECK: [[DATA:%.+]] = bitcast i8* [[ALLOC]] to [[PRIVATES_TY]]*
37-
// CHECK: [[D:%.+]] = load i8*, i8** [[D_ADDR]],
37+
// CHECK: [[D:%.+]] = load i8*, i8** [[D_ADDR]], align 8
3838
// CHECK: [[D_DEP:%.+]] = bitcast i8* [[D]] to %struct.kmp_depend_info*
3939
// CHECK: [[D_DEP_BASE:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[D_DEP]], i{{.+}} -1
4040
// CHECK: [[D_DEP_BASE_SIZE:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[D_DEP_BASE]], i{{.+}} 0, i{{.+}} 0
41-
// CHECK: [[SIZE1:%.+]] = load i64, i64* [[D_DEP_BASE_SIZE]],
42-
// CHECK-DAG: store i64 0, i64* [[DEPOBJ_SIZE_ADDR]],
43-
// CHECK: [[SZ:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR]],
41+
// CHECK: [[SIZE1:%.+]] = load i64, i64* [[D_DEP_BASE_SIZE]], align 8
42+
// CHECK-DAG: store i64 0, i64* [[DEPOBJ_SIZE_ADDR]], align 8
43+
// CHECK: [[SZ:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR]], align 8
4444
// CHECK: [[SIZE:%.+]] = add nuw i64 [[SZ]], [[SIZE1]]
45-
// CHECK: store i64 [[SIZE]], i64* [[DEPOBJ_SIZE_ADDR]],
46-
// CHECK: [[X:%.+]] = load i8*, i8** [[X_ADDR]],
45+
// CHECK: store i64 [[SIZE]], i64* [[DEPOBJ_SIZE_ADDR]], align 8
46+
// CHECK: [[X:%.+]] = load i8*, i8** [[X_ADDR]], align 8
4747
// CHECK: [[X_DEP:%.+]] = bitcast i8* [[X]] to %struct.kmp_depend_info*
4848
// CHECK: [[X_DEP_BASE:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[X_DEP]], i{{.+}} -1
4949
// CHECK: [[X_DEP_BASE_SIZE:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[X_DEP_BASE]], i{{.+}} 0, i{{.+}} 0
50-
// CHECK: [[SIZE2:%.+]] = load i64, i64* [[X_DEP_BASE_SIZE]],
51-
// CHECK-DAG: store i64 0, i64* [[DEPOBJ_SIZE_ADDR1]],
52-
// CHECK: [[SZ:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR1]],
50+
// CHECK: [[SIZE2:%.+]] = load i64, i64* [[X_DEP_BASE_SIZE]], align 8
51+
// CHECK-DAG: store i64 0, i64* [[DEPOBJ_SIZE_ADDR1]], align 8
52+
// CHECK: [[SZ:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR1]], align 8
5353
// CHECK: [[SIZE3:%.+]] = add nuw i64 [[SZ]], [[SIZE2]]
54-
// CHECK: store i64 [[SIZE3]], i64* [[DEPOBJ_SIZE_ADDR1]],
55-
// CHECK: [[SZ:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR]],
56-
// CHECK: [[SZ1:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR1]],
54+
// CHECK: store i64 [[SIZE3]], i64* [[DEPOBJ_SIZE_ADDR1]], align 8
55+
// CHECK: [[SZ:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR]], align 8
56+
// CHECK: [[SZ1:%.+]] = load i64, i64* [[DEPOBJ_SIZE_ADDR1]], align 8
5757
// CHECK: [[SIZE1:%.+]] = add nuw i64 0, [[SZ]]
5858
// CHECK: [[SIZE2:%.+]] = add nuw i64 [[SIZE1]], [[SZ1]]
5959
// CHECK: [[SIZE:%.+]] = add nuw i64 [[SIZE2]], 2
6060
// CHECK: [[SV:%.+]] = call i8* @llvm.stacksave()
61-
// CHECK: store i8* [[SV]], i8** [[SV_ADDR:%.+]],
61+
// CHECK: store i8* [[SV]], i8** [[SV_ADDR:%.+]], align 8
6262
// CHECK: [[VLA:%.+]] = alloca %struct.kmp_depend_info, i64 [[SIZE]],
6363
// CHECK: [[SIZE32:%.+]] = trunc i64 [[SIZE]] to i32
6464
// CHECK: [[VLA0:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA]], i64 0
6565
// CHECK: [[BASE_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA0]], i{{.+}} 0, i{{.+}} 0
6666
// CHECK: [[A_ADDR_CAST:%.+]] = ptrtoint i32* [[A_ADDR]] to i64
67-
// CHECK: store i64 [[A_ADDR_CAST]], i64* [[BASE_ADDR]],
67+
// CHECK: store i64 [[A_ADDR_CAST]], i64* [[BASE_ADDR]], align 16
6868
// CHECK: [[SIZE_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA0]], i{{.+}} 0, i{{.+}} 1
69-
// CHECK: store i64 4, i64* [[SIZE_ADDR]],
69+
// CHECK: store i64 4, i64* [[SIZE_ADDR]], align 8
7070
// CHECK: [[FLAGS_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA0]], i{{.+}} 0, i{{.+}} 2
71-
// CHECK: store i8 1, i8* [[FLAGS_ADDR]],
72-
// CHECK: [[A:%.+]] = load i32, i32* [[A_ADDR]],
71+
// CHECK: store i8 1, i8* [[FLAGS_ADDR]], align 1
72+
// CHECK: [[A:%.+]] = load i32, i32* [[A_ADDR]], align 4
7373
// CHECK: [[A_CAST:%.+]] = sext i32 [[A]] to i64
7474
// CHECK: [[SZ1:%.+]] = mul nuw i64 24, [[A_CAST]]
75-
// CHECK: [[A:%.+]] = load i32, i32* [[A_ADDR]],
75+
// CHECK: [[A:%.+]] = load i32, i32* [[A_ADDR]], align 4
7676
// CHECK: [[A_CAST:%.+]] = sext i32 [[A]] to i64
7777
// CHECK: [[SZ:%.+]] = mul nuw i64 [[SZ1]], [[A_CAST]]
7878
// CHECK: [[VLA1:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA]], i64 1
7979
// CHECK: [[BASE_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA1]], i{{.+}} 0, i{{.+}} 0
8080
// CHECK: [[B_ADDR_CAST:%.+]] = ptrtoint i32** %{{.+}} to i64
81-
// CHECK: store i64 [[B_ADDR_CAST]], i64* [[BASE_ADDR]],
81+
// CHECK: store i64 [[B_ADDR_CAST]], i64* [[BASE_ADDR]], align 8
8282
// CHECK: [[SIZE_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA1]], i{{.+}} 0, i{{.+}} 1
83-
// CHECK: store i64 [[SZ]], i64* [[SIZE_ADDR]],
83+
// CHECK: store i64 [[SZ]], i64* [[SIZE_ADDR]], align 8
8484
// CHECK: [[FLAGS_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA1]], i{{.+}} 0, i{{.+}} 2
85-
// CHECK: store i8 1, i8* [[FLAGS_ADDR]],
86-
// CHECK: store i64 2, i64* [[DEP_COUNTER_ADDR]],
87-
// CHECK: [[D:%.+]] = load i8*, i8** [[D_ADDR]],
85+
// CHECK: store i8 1, i8* [[FLAGS_ADDR]], align 8
86+
// CHECK: store i64 2, i64* [[DEP_COUNTER_ADDR]], align 8
87+
// CHECK: [[D:%.+]] = load i8*, i8** [[D_ADDR]], align 8
8888
// CHECK: [[BC:%.+]] = bitcast i8* [[D]] to %struct.kmp_depend_info*
8989
// CHECK: [[PREV:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[BC]], i64 -1
9090
// CHECK: [[SIZE_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[PREV]], i{{.+}} 0, i{{.+}} 0
91-
// CHECK: [[SIZE:%.+]] = load i64, i64* [[SIZE_ADDR]],
91+
// CHECK: [[SIZE:%.+]] = load i64, i64* [[SIZE_ADDR]], align 8
9292
// CHECK: [[BYTES:%.+]] = mul nuw i64 24, [[SIZE]]
93-
// CHECK: [[POS:%.+]] = load i64, i64* [[DEP_COUNTER_ADDR]],
93+
// CHECK: [[POS:%.+]] = load i64, i64* [[DEP_COUNTER_ADDR]], align 8
9494
// CHECK: [[VLA_D:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA]], i64 [[POS]]
9595
// CHECK: [[DEST:%.+]] = bitcast %struct.kmp_depend_info* [[VLA_D]] to i8*
9696
// CHECK: [[SRC:%.+]] = bitcast %struct.kmp_depend_info* [[BC]] to i8*
9797
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{.+}} [[DEST]], i8* align {{.+}} [[SRC]], i64 [[BYTES]], i1 false)
9898
// CHECK: [[ADD:%.+]] = add nuw i64 [[POS]], [[SIZE]]
99-
// CHECK: store i64 [[ADD]], i64* [[DEP_COUNTER_ADDR]],
100-
// CHECK: [[X:%.+]] = load i8*, i8** [[X_ADDR]],
99+
// CHECK: store i64 [[ADD]], i64* [[DEP_COUNTER_ADDR]], align 8
100+
// CHECK: [[X:%.+]] = load i8*, i8** [[X_ADDR]], align 8
101101
// CHECK: [[BC:%.+]] = bitcast i8* [[X]] to %struct.kmp_depend_info*
102102
// CHECK: [[PREV:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[BC]], i64 -1
103103
// CHECK: [[SIZE_ADDR:%.+]] = getelementptr inbounds %struct.kmp_depend_info, %struct.kmp_depend_info* [[PREV]], i{{.+}} 0, i{{.+}} 0
104-
// CHECK: [[SIZE:%.+]] = load i64, i64* [[SIZE_ADDR]],
104+
// CHECK: [[SIZE:%.+]] = load i64, i64* [[SIZE_ADDR]], align 8
105105
// CHECK: [[BYTES:%.+]] = mul nuw i64 24, [[SIZE]]
106-
// CHECK: [[POS:%.+]] = load i64, i64* [[DEP_COUNTER_ADDR]],
106+
// CHECK: [[POS:%.+]] = load i64, i64* [[DEP_COUNTER_ADDR]], align 8
107107
// CHECK: [[VLA_X:%.+]] = getelementptr %struct.kmp_depend_info, %struct.kmp_depend_info* [[VLA]], i64 [[POS]]
108108
// CHECK: [[DEST:%.+]] = bitcast %struct.kmp_depend_info* [[VLA_X]] to i8*
109109
// CHECK: [[SRC:%.+]] = bitcast %struct.kmp_depend_info* [[BC]] to i8*
110110
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align {{.+}} [[DEST]], i8* align {{.+}} [[SRC]], i64 [[BYTES]], i1 false)
111111
// CHECK: [[ADD:%.+]] = add nuw i64 [[POS]], [[SIZE]]
112-
// CHECK: store i64 [[ADD]], i64* [[DEP_COUNTER_ADDR]],
112+
// CHECK: store i64 [[ADD]], i64* [[DEP_COUNTER_ADDR]], align 8
113113
// CHECK: [[BC:%.+]] = bitcast %struct.kmp_depend_info* [[VLA]] to i8*
114114
// CHECK: call i32 @__kmpc_omp_task_with_deps(%struct.ident_t* @{{.+}}, i32 [[GTID]], i8* [[ALLOC]], i32 [[SIZE32]], i8* [[BC]], i32 0, i8* null)
115-
// CHECK: [[SV:%.+]] = load i8*, i8** [[SV_ADDR]],
115+
// CHECK: [[SV:%.+]] = load i8*, i8** [[SV_ADDR]], align 8
116116
// CHECK: call void @llvm.stackrestore(i8* [[SV]])
117117
#pragma omp task depend(in: a, ([3][a][a])&b) depend(depobj: d, x) detach(evt)
118118
{

0 commit comments

Comments
 (0)