[PATCH] D19258: Loop vectorization with induction variable with non-constant step.

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 11:17:34 PDT 2016


delena added inline comments.

================
Comment at: ../lib/Transforms/Utils/LoopUtils.cpp:738-739
@@ +737,4 @@
+  else {
+    SetVector<Value *> *Set = SE->getSCEVValues(Step);
+    if (!Set || Set->size() != 1)
+      return false;
----------------
hfinkel wrote:
> I don't think this is a good way to handle this, because we'll run into all kinds of non-trivial situations where SCEV has computed an expression for the step that does not exactly correspond to a pre-existing IR value. We won't handle those cases, and it will be nearly impossible for a user to understand why.
> 
> Instead, convert StepValue in InductionDescriptor to a const SCEV *, and then when we need the Value* when generating IR, get one from the SCEVBuilder. It will reuse an existing Value* should one exist.
I can't find a way to build a Value from SCEV. If the Step is "SCEVAddRecExpr", how do I get Value* from it? 


Repository:
  rL LLVM

http://reviews.llvm.org/D19258





More information about the llvm-commits mailing list