[LV] FoldTail w/o Primary Induction
authorAyal Zaks <ayal.zaks@intel.com>
Mon, 6 Apr 2020 22:53:59 +0000 (01:53 +0300)
committerAyal Zaks <ayal.zaks@intel.com>
Thu, 9 Apr 2020 14:45:23 +0000 (17:45 +0300)
commit16784892347b213da1d53bc05f59984d66dd014d
tree056d0618a7aae88390a7d27b6046b526b153e781
parent023c4d400ef5acf3a7339dc8452ce552b15a9ae4
[LV] FoldTail w/o Primary Induction

Introduce a new VPWidenCanonicalIVRecipe to generate a canonical vector
induction for use in fold-tail-with-masking, if a primary induction is absent.

The canonical scalar IV having start = 0 and step = VF*UF, created during code
-gen to control the vector loop, is widened into a canonical vector IV having
start = {<Part*VF, Part*VF+1, ..., Part*VF+VF-1> for 0 <= Part < UF} and
step = <VF*UF, VF*UF, ..., VF*UF>.

Differential Revision: https://reviews.llvm.org/D77635
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/VPlan.cpp
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/test/Transforms/LoopVectorize/X86/small-size.ll
llvm/test/Transforms/LoopVectorize/tail-folding-counting-down.ll