diff options
author | Gil Rapaport <gil.rapaport@intel.com> | 2019-10-16 21:39:53 +0300 |
---|---|---|
committer | Gil Rapaport <gil.rapaport@intel.com> | 2019-12-06 13:41:19 +0200 |
commit | 39ccc099c901ca511f0c43f163adef6699038326 (patch) | |
tree | 72cad377c703b01e25bdaa56784bbc5d0f1add8e /llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp | |
parent | b31a531f9bbf7a3ae193df6009f5ee542f760017 (diff) | |
download | bcm5719-llvm-39ccc099c901ca511f0c43f163adef6699038326.tar.gz bcm5719-llvm-39ccc099c901ca511f0c43f163adef6699038326.zip |
[LV] Record GEP widening decisions in recipe (NFCI)
InnerLoopVectorizer's code called during VPlan execution still relies on
original IR's def-use relations to decide which vector code to generate,
limiting VPlan transformations ability to modify def-use relations and still
have ILV generate the vector code.
This commit moves GEP operand queries controlling how GEPs are widened to a
dedicated recipe and extracts GEP widening code to its own ILV method taking
those recorded decisions as arguments. This reduces ingredient def-use usage by
ILV as a step towards full VPlan-based def-use relations.
Differential revision: https://reviews.llvm.org/D69067
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp index b22d3190d65..99ef12d1780 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanHCFGTransforms.cpp @@ -17,7 +17,7 @@ using namespace llvm; void VPlanHCFGTransforms::VPInstructionsToVPRecipes( - VPlanPtr &Plan, + Loop *OrigLoop, VPlanPtr &Plan, LoopVectorizationLegality::InductionList *Inductions, SmallPtrSetImpl<Instruction *> &DeadInstructions) { @@ -64,6 +64,8 @@ void VPlanHCFGTransforms::VPInstructionsToVPRecipes( NewRecipe = new VPWidenIntOrFpInductionRecipe(Phi); } else NewRecipe = new VPWidenPHIRecipe(Phi); + } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { + NewRecipe = new VPWidenGEPRecipe(GEP, OrigLoop); } else { // If the last recipe is a VPWidenRecipe, add Inst to it instead of // creating a new recipe. |