[PATCH] D12475: [LV] Pull creation of trip counts into a helper function.

Michael Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 30 13:44:02 PDT 2015


mzolotukhin added a comment.

Hi James,

Comments inline:


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2763
@@ +2762,3 @@
+
+  Builder.SetInsertPoint(VectorPH->getTerminator());
+  StartIdx = ConstantInt::get(IdxTy, 0);
----------------
This insertion point is overwritten a couple of lines below.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2789
@@ -2753,3 +2788,3 @@
   // Add the start index to the loop count to get the new end index.
-  Value *IdxEnd = BypassBuilder.CreateAdd(Count, StartIdx, "end.idx");
+  Value *CountRoundDown = getOrCreateVectorTripCount(Lp);
 
----------------
Please double-check whether we generate instructions at the same location, as before the change. I suspect we're doing it in `VecBody` instead of `VectorPH` now, though I didn't check it.
Also, since it's an NFC, it would be a good to verify it by comparing output IR on existing tests before and after the change.


Repository:
  rL LLVM

http://reviews.llvm.org/D12475





More information about the llvm-commits mailing list