[Loop Vectorizer] Handling loops FP induction variables.
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Sun, 24 Jul 2016 07:24:54 +0000 (07:24 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Sun, 24 Jul 2016 07:24:54 +0000 (07:24 +0000)
commit376a18bd92be99385d3f9b2c159775b22603fd6f
tree8a614e329fe0f00624605a3574bd8327de9b60d6
parent93ea19b9a63f6c3f5d60d211b518051e2c714803
[Loop Vectorizer] Handling loops FP induction variables.

Allowed loop vectorization with secondary FP IVs. Like this:
float *A;
float x = init;
for (int i=0; i < N; ++i) {
  A[i] = x;
  x -= fp_inc;
}

The auto-vectorization is possible when the induction binary operator is "fast" or the function has "unsafe" attribute.

Differential Revision: https://reviews.llvm.org/D21330

llvm-svn: 276554
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/Transforms/Scalar/LoopInterchange.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/X86/float-induction-x86.ll [new file with mode: 0644]
llvm/test/Transforms/LoopVectorize/float-induction.ll [new file with mode: 0644]