diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-01-29 18:51:58 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-01-29 18:51:58 +0000 |
commit | 316ccf60c9094d0b6c32761526782bd407bc3099 (patch) | |
tree | bd62fce6080334a84add8f6b3eb8e0b7b51c792c /clang/test/OpenMP/parallel_for_codegen.cpp | |
parent | db9152c248d242ff89c62bc350250e8064f229ed (diff) | |
download | bcm5719-llvm-316ccf60c9094d0b6c32761526782bd407bc3099.tar.gz bcm5719-llvm-316ccf60c9094d0b6c32761526782bd407bc3099.zip |
[OPENMP]Make the loop with unsigned counter countable.
According to the report, better to keep the original strict compare
operation as the loop condition with unsigned loop counters to make the
loop countable. This allows further loop transformations.
llvm-svn: 352526
Diffstat (limited to 'clang/test/OpenMP/parallel_for_codegen.cpp')
-rw-r--r-- | clang/test/OpenMP/parallel_for_codegen.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/test/OpenMP/parallel_for_codegen.cpp b/clang/test/OpenMP/parallel_for_codegen.cpp index a3d307afac9..fe1eb1ef114 100644 --- a/clang/test/OpenMP/parallel_for_codegen.cpp +++ b/clang/test/OpenMP/parallel_for_codegen.cpp @@ -197,7 +197,8 @@ void dynamic1(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] @@ -239,7 +240,8 @@ void guided7(float *a, float *b, float *c, float *d) { // CHECK: [[IV:%.+]] = load i64, i64* [[OMP_IV]] // CHECK-NEXT: [[UB:%.+]] = load i64, i64* [[OMP_UB]] -// CHECK-NEXT: [[CMP:%.+]] = icmp ule i64 [[IV]], [[UB]] +// CHECK-NEXT: [[BOUND:%.+]] = add i64 [[UB]], 1 +// CHECK-NEXT: [[CMP:%.+]] = icmp ult i64 [[IV]], [[BOUND]] // CHECK-NEXT: br i1 [[CMP]], label %[[LOOP1_BODY:[^,]+]], label %[[LOOP1_END:[^,]+]] for (unsigned long long i = 131071; i < 2147483647; i += 127) { // CHECK: [[LOOP1_BODY]] |