summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/parallel_for_codegen.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-01-29 18:51:58 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-01-29 18:51:58 +0000
commit316ccf60c9094d0b6c32761526782bd407bc3099 (patch)
treebd62fce6080334a84add8f6b3eb8e0b7b51c792c /clang/test/OpenMP/parallel_for_codegen.cpp
parentdb9152c248d242ff89c62bc350250e8064f229ed (diff)
downloadbcm5719-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.cpp6
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]]
OpenPOWER on IntegriCloud