[PATCH] [Polly] Delinearize _all_ accesses to a multi-dimensional array

Sebastian Pop sebpop at gmail.com
Fri Sep 12 12:17:09 PDT 2014


================
Comment at: lib/Analysis/ScopDetection.cpp:369
@@ -368,3 +368,3 @@
     SmallVector<const SCEV *, 4> Terms;
-    for (PairInsnAddRec PIAF : Context.NonAffineAccesses[BasePointer])
-      PIAF.second->collectParametricTerms(*SE, Terms);
+    for (const auto &PIAF : Context.Accesses[BasePointer]) {
+      const SCEVAddRecExpr *AccessFunction =
----------------
jdoerfert wrote:
> What does PIAF mean?
Pair <Instruction, AccessFunction> 

================
Comment at: lib/Analysis/ScopDetection.cpp:412
@@ +411,3 @@
+                                   Shape->DelinearizedSizes);
+        if (!Acc->DelinearizedSubscripts.empty()) {
+          for (const SCEV *S : Acc->DelinearizedSubscripts)
----------------
jdoerfert wrote:
> The nested if statements make this harder to understand than it actually is.
> 
> Maybe we should just copy the isEmpty check, first if it is empty, then if it is not.
It is simpler to read the if statements when the short clause comes first:

```
if (Shape->DelinearizedSizes.empty()) {
  IsNonAffine = true;
} else {
  [...]
  if (Acc->DelinearizedSubscripts.empty()) {
    IsNonAffine = true;
  } else {
     // Long clause goes here.
     [...]
  }
}

```

http://reviews.llvm.org/D5329






More information about the llvm-commits mailing list