]> granicus.if.org Git - llvm/commit
[LV] Using VPlan to model the vectorized code and drive its transformation
authorAyal Zaks <ayal.zaks@intel.com>
Thu, 17 Aug 2017 09:29:59 +0000 (09:29 +0000)
committerAyal Zaks <ayal.zaks@intel.com>
Thu, 17 Aug 2017 09:29:59 +0000 (09:29 +0000)
commitcd8f8f7fd42a87694671cd27e12b1d5e16fbde68
treeabab0375cced63a68f7ed8e6276ff3d741cea15c
parent2cd3b1f607b75e4e47d14da113f88d9db5d5f1bf
[LV] Using VPlan to model the vectorized code and drive its transformation

VPlan is an ongoing effort to refactor and extend the Loop Vectorizer. This
patch introduces the VPlan model into LV and uses it to represent the vectorized
code and drive the generation of vectorized IR.

In this patch VPlan models the vectorized loop body: the vectorized control-flow
is represented using VPlan's Hierarchical CFG, with predication refactored from
being a post-vectorization-step into a vectorization planning step modeling
if-then VPRegionBlocks, and generating code inline with non-predicated code. The
vectorized code within each VPBasicBlock is represented as a sequence of
Recipes, each responsible for modelling and generating a sequence of IR
instructions. To keep the size of this commit manageable the Recipes in this
patch are coarse-grained and capture large chunks of LV's code-generation logic.
The constructed VPlans are dumped in dot format under -debug.

This commit retains current vectorizer output, except for minor instruction
reorderings; see associated modifications to lit tests.

For further details on the VPlan model see docs/Proposals/VectorizationPlan.rst
and its references.

Authors: Gil Rapaport and Ayal Zaks

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311077 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/CMakeLists.txt
lib/Transforms/Vectorize/LoopVectorize.cpp
lib/Transforms/Vectorize/VPlan.cpp [new file with mode: 0644]
lib/Transforms/Vectorize/VPlan.h [new file with mode: 0644]
test/Transforms/LoopVectorize/AArch64/aarch64-predication.ll
test/Transforms/LoopVectorize/AArch64/predication_costs.ll
test/Transforms/LoopVectorize/SystemZ/load-store-scalarization-cost.ll
test/Transforms/LoopVectorize/first-order-recurrence.ll
test/Transforms/LoopVectorize/if-pred-non-void.ll