[PATCH] D11771: Fix how DependenceAnalysis calls de-linearization

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 01:25:39 PDT 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Analysis/DependenceAnalysis.cpp:3247
@@ -3246,5 +3246,3 @@
 /// for each loop level.
-bool DependenceAnalysis::tryDelinearize(const SCEV *SrcSCEV,
-                                        const SCEV *DstSCEV,
-                                        SmallVectorImpl<Subscript> &Pair,
-                                        const SCEV *ElementSize) {
+bool DependenceAnalysis::tryDelinearize(Instruction *Src,
+                                        Instruction *Dst,
----------------
Can these be const Instruction*?

================
Comment at: lib/Analysis/DependenceAnalysis.cpp:3255
@@ +3254,3 @@
+  Loop *SrcLoop = LI->getLoopFor(Src->getParent());
+  Loop *DstLoop = LI->getLoopFor(Dst->getParent());
+
----------------
The code in Delinearization.cpp does this:

    // Delinearize the memory access as analyzed in all the surrounding loops.
    // Do not analyze memory accesses outside loops.
    for (Loop *L = LI->getLoopFor(BB); L != nullptr; L = L->getParentLoop()) {
      const SCEV *AccessFn = SE->getSCEVAtScope(getPointerOperand(*Inst), L);

So it walks up the chain of loops instead of just always using the inner loop. Should something similar be done here?

================
Comment at: lib/Analysis/DependenceAnalysis.cpp:3429
@@ -3428,3 @@
-  if (Delinearize && Pairs == 1 && CommonLevels > 1 &&
-      tryDelinearize(Pair[0].Src, Pair[0].Dst, Pair, SE->getElementSize(Src))) {
-    DEBUG(dbgs() << "    delinerized GEP\n");
----------------
Am I correct that an alternative way to fix this problem is to call getSCEVAtScope on the SCEVs being passed here?



Repository:
  rL LLVM

http://reviews.llvm.org/D11771





More information about the llvm-commits mailing list