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

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 05:49:24 PDT 2016


delena updated this revision to Diff 55587.
delena added a comment.
Herald added a subscriber: sanjoy.

Following Hal's and Matthew comments, I keep Step as a SCEV inside InductionDescriptor. It allows to vectorize loop with induction variable with any *loop-invariant* step.
Again, we are talking about a "secondary" induction variable, which is being updated inside loop, but does not participate in trip count calculation.

I added one more example, where the step is a SCEV from outer loop:

  for (int j = 0; j < M; j++) {
    for (int i=0; i<N; i++){
      A[i] = x;
      x += j; // loop-invariant step
    }
  }


Repository:
  rL LLVM

http://reviews.llvm.org/D19258

Files:
  ../include/llvm/Transforms/Utils/LoopUtils.h
  ../lib/Transforms/Utils/LoopUtils.cpp
  ../lib/Transforms/Vectorize/LoopVectorize.cpp
  ../test/Transforms/LoopVectorize/induction-step.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19258.55587.patch
Type: text/x-patch
Size: 20962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160429/5d1ba01b/attachment.bin>


More information about the llvm-commits mailing list