[PATCH] D18878: [Polly] Allow overflow of indices with constant dimensions size

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 16:42:05 PDT 2016


Meinersbur added a comment.

Not meant as fix for PR27195. It does not fix the vec-delin.ll test case. The uploaded test case delinearization-fixed-size.ll seems unrelated to the first one. Tobias already partially fixed that latter in r265379.


================
Comment at: lib/Analysis/ScopInfo.cpp:343
@@ +342,3 @@
+  auto *LArraySpace = isl_local_space_from_space(isl_space_copy(ArraySpace));
+  if (DimsMissing)
+    for (int i = DimsArray - 1; i > 0; i--) {
----------------
Removing this causes a lot more changes in unit tests.

================
Comment at: test/ScopInfo/multidim_fixedsize_multi_offset.ll:12
@@ -11,3 +23,3 @@
 ;        B[i][0]++;
 ;        C[i][0]++;
 ;      }
----------------
The scop was only rejected because the computed MemoryAccess was
```
{ [i0] -> MemRef_A[0, 2 + 2i0] }
```
which is unconditionally out of bounds.

================
Comment at: test/ScopInfo/process_added_dimensions.ll:3-4
@@ -2,9 +2,4 @@
 
-; This test case produces the following memory access which we try hoist:
-; { Stmt_for_cond40_preheader_5[i0] -> MemRef_call[0, 0, 2240] }. However, it
-; accesses an array of size "i32 MemRef_call[*][6][64]".  That is why we
-; should turn the whole SCoP into an invalid SCoP using corresponding bounds
-; checks. Otherwise, we derive the incorrect access.
-
-; CHECK: Valid Region for Scop: for.cond40.preheader.4 => for.end76
-; CHECK-NOT:     Region: %for.cond40.preheader.4---%for.end76
+; CHECK:      Invariant Accesses: {
+; CHECK-NEXT: }
+; CHECK:      Statements {
----------------
The unit test is accepted and I don't find anything wrong. Can somebody double-check?

Especially because there is no hoisted load, but MemRef_call[5, 5, 0] is the correct access (instead of MemRef_call[0, 0, 2240])

================
Comment at: test/ScopInfo/process_added_dimensions.ll:38
@@ -25,3 +37,3 @@
 for.end76:                                        ; preds = %for.inc71.5
-  ret void
+  ret i32 %.pre160
 
----------------
Stmt_for_cond40_preheader_5 would disappear without this change as %.pre160 is otherwise unused.


http://reviews.llvm.org/D18878





More information about the llvm-commits mailing list