[PATCH] D20789: Consecutive memory access in Loop Vectorizer - fixed and simplified

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 06:44:23 PDT 2016


delena added inline comments.

================
Comment at: ../lib/Analysis/LoopAccessAnalysis.cpp:913-917
@@ -861,1 +912,7 @@
 
+  if (!AR)
+    // One more attempt to get stride from GEP with index calculated in runtime
+    if (auto *Gep = dyn_cast<GetElementPtrInst>(Ptr))
+      if (int Stride = getConsecutiveAccessFromGEPIndex(PSE, Gep, Lp, StridesMap))
+        return Stride;
+
----------------
anemet wrote:
> Sorry for jumping in late but I was on vacation.  Elena, does your testcase actually exercise this part of the code or it's handled as a regular AddRec above?  I am assuming not since the Ptr is not a GEP.
> 
> Do we actually have coverage exercising this part?
> 
The test that exercises this code is in version-mem-access.ll. This is the existing test that fails without this extension. 
My test case does not have GEP (but it has AddRec ) and this case wan't handled properly.

================
Comment at: ../test/Transforms/LoopVectorize/consec_no_gep.ll:7
@@ +6,3 @@
+;; Check consecutive memory access without preceding GEP instruction
+
+;  for (int i=0; i<len; i++) {
----------------
anemet wrote:
> The C code and the IR do not match here.  You have some casts here.  Can this testcase be simplified to remove the casts?
I ran clang and printed IR before loop vectorizer. So, the code is exact here.


Repository:
  rL LLVM

http://reviews.llvm.org/D20789





More information about the llvm-commits mailing list