diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2018-08-13 19:04:24 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2018-08-13 19:04:24 +0000 |
| commit | f138fda5edc21004de744ed354e9142b8c2ee109 (patch) | |
| tree | 4ac27ec6f84105423228f2ddcdba22bd528636c8 /clang/test/OpenMP/ordered_doacross_codegen.c | |
| parent | 2da1ef5b9eb12043866b022bb7ea38c705e76d93 (diff) | |
| download | bcm5719-llvm-f138fda5edc21004de744ed354e9142b8c2ee109.tar.gz bcm5719-llvm-f138fda5edc21004de744ed354e9142b8c2ee109.zip | |
[OPENMP] Fix emission of the loop doacross constructs.
The number of loops associated with the OpenMP loop constructs should
not be considered as the number loops to collapse.
llvm-svn: 339603
Diffstat (limited to 'clang/test/OpenMP/ordered_doacross_codegen.c')
| -rw-r--r-- | clang/test/OpenMP/ordered_doacross_codegen.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/clang/test/OpenMP/ordered_doacross_codegen.c b/clang/test/OpenMP/ordered_doacross_codegen.c index c12df2638f8..a6cd4fe48b3 100644 --- a/clang/test/OpenMP/ordered_doacross_codegen.c +++ b/clang/test/OpenMP/ordered_doacross_codegen.c @@ -19,17 +19,19 @@ void foo(); // CHECK-LABEL: @main() int main() { int i; -// CHECK: [[DIMS:%.+]] = alloca [[KMP_DIM]], +// CHECK: [[DIMS:%.+]] = alloca [1 x [[KMP_DIM]]], // CHECK: [[GTID:%.+]] = call i32 @__kmpc_global_thread_num([[IDENT:%.+]]) // CHECK: icmp // CHECK-NEXT: br i1 % -// CHECK: [[CAST:%.+]] = bitcast [[KMP_DIM]]* [[DIMS]] to i8* +// CHECK: [[CAST:%.+]] = bitcast [1 x [[KMP_DIM]]]* [[DIMS]] to i8* // CHECK: call void @llvm.memset.p0i8.i64(i8* align 8 [[CAST]], i8 0, i64 24, i1 false) -// CHECK: getelementptr inbounds [[KMP_DIM]], [[KMP_DIM]]* [[DIMS]], i32 0, i32 1 +// CHECK: [[DIM:%.+]] = getelementptr inbounds [1 x [[KMP_DIM]]], [1 x [[KMP_DIM]]]* [[DIMS]], i64 0, i64 0 +// CHECK: getelementptr inbounds [[KMP_DIM]], [[KMP_DIM]]* [[DIM]], i32 0, i32 1 // CHECK: store i64 %{{.+}}, i64* % -// CHECK: getelementptr inbounds [[KMP_DIM]], [[KMP_DIM]]* [[DIMS]], i32 0, i32 2 +// CHECK: getelementptr inbounds [[KMP_DIM]], [[KMP_DIM]]* [[DIM]], i32 0, i32 2 // CHECK: store i64 1, i64* % -// CHECK: [[CAST:%.+]] = bitcast [[KMP_DIM]]* [[DIMS]] to i8* +// CHECK: [[DIM:%.+]] = getelementptr inbounds [1 x [[KMP_DIM]]], [1 x [[KMP_DIM]]]* [[DIMS]], i64 0, i64 0 +// CHECK: [[CAST:%.+]] = bitcast [[KMP_DIM]]* [[DIM]] to i8* // CHECK: call void @__kmpc_doacross_init([[IDENT]], i32 [[GTID]], i32 1, i8* [[CAST]]) // CHECK: call void @__kmpc_for_static_init_4( #pragma omp for ordered(1) @@ -37,18 +39,26 @@ int main() { a[i] = b[i] + 1; foo(); // CHECK: call void [[FOO:.+]]( -// CHECK: load i32, i32* [[CNT:%.+]], +// CHECK: load i32, i32* [[I:%.+]], +// CHECK-NEXT: sub nsw i32 %{{.+}}, 0 +// CHECK-NEXT: sdiv i32 %{{.+}}, 1 // CHECK-NEXT: sext i32 %{{.+}} to i64 -// CHECK-NEXT: store i64 %{{.+}}, i64* [[TMP:%.+]], +// CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT:%.+]], i64 0, i64 0 +// CHECK-NEXT: store i64 %{{.+}}, i64* [[TMP]], +// CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT]], i64 0, i64 0 // CHECK-NEXT: call void @__kmpc_doacross_post([[IDENT]], i32 [[GTID]], i64* [[TMP]]) #pragma omp ordered depend(source) c[i] = c[i] + 1; foo(); // CHECK: call void [[FOO]] -// CHECK: load i32, i32* [[CNT]], +// CHECK: load i32, i32* [[I]], // CHECK-NEXT: sub nsw i32 %{{.+}}, 2 +// CHECK-NEXT: sub nsw i32 %{{.+}}, 0 +// CHECK-NEXT: sdiv i32 %{{.+}}, 1 // CHECK-NEXT: sext i32 %{{.+}} to i64 -// CHECK-NEXT: store i64 %{{.+}}, i64* [[TMP:%.+]], +// CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT:%.+]], i64 0, i64 0 +// CHECK-NEXT: store i64 %{{.+}}, i64* [[TMP]], +// CHECK-NEXT: [[TMP:%.+]] = getelementptr inbounds [1 x i64], [1 x i64]* [[CNT]], i64 0, i64 0 // CHECK-NEXT: call void @__kmpc_doacross_wait([[IDENT]], i32 [[GTID]], i64* [[TMP]]) #pragma omp ordered depend(sink : i - 2) d[i] = a[i - 2]; |

