Skip to content

Commit e983420

Browse files
committed
[VPlan] Move convertToConreteRecipes to end of VPlan-opt phase (NFCI).
Adjust placement as suggested in #114305, after some refactoring to prepare for the move.
1 parent a2d086a commit e983420

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7734,10 +7734,11 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
77347734
VPlanTransforms::unrollByUF(BestVPlan, BestUF,
77357735
OrigLoop->getHeader()->getContext());
77367736
VPlanTransforms::optimizeForVFAndUF(BestVPlan, BestVF, BestUF, PSE);
7737+
VPlanTransforms::convertToConcreteRecipes(BestVPlan);
77377738

77387739
// Perform the actual loop transformation.
77397740
VPTransformState State(&TTI, BestVF, BestUF, LI, DT, ILV.Builder, &ILV,
7740-
&BestVPlan);
7741+
&BestVPlan, Legal->getWidestInductionType());
77417742

77427743
// 0. Generate SCEV-dependent code into the preheader, including TripCount,
77437744
// before making any changes to the CFG.
@@ -7794,7 +7795,6 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
77947795
// 2. Copy and widen instructions from the old loop into the new loop.
77957796
BestVPlan.prepareToExecute(ILV.getTripCount(),
77967797
ILV.getOrCreateVectorTripCount(nullptr), State);
7797-
VPlanTransforms::convertToConcreteRecipes(BestVPlan);
77987798

77997799
BestVPlan.execute(&State);
78007800

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ VPBasicBlock::iterator VPBasicBlock::getFirstNonPhi() {
222222
VPTransformState::VPTransformState(const TargetTransformInfo *TTI,
223223
ElementCount VF, unsigned UF, LoopInfo *LI,
224224
DominatorTree *DT, IRBuilderBase &Builder,
225-
InnerLoopVectorizer *ILV, VPlan *Plan)
225+
InnerLoopVectorizer *ILV, VPlan *Plan,
226+
Type *CanonicalIVTy)
226227
: TTI(TTI), VF(VF), CFG(DT), LI(LI), Builder(Builder), ILV(ILV), Plan(Plan),
227-
LVer(nullptr), TypeAnalysis(Plan->getCanonicalIV()->getScalarType()) {}
228+
LVer(nullptr), TypeAnalysis(CanonicalIVTy) {}
228229

229230
Value *VPTransformState::get(VPValue *Def, const VPLane &Lane) {
230231
if (Def->isLiveIn())

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class VPLane {
236236
struct VPTransformState {
237237
VPTransformState(const TargetTransformInfo *TTI, ElementCount VF, unsigned UF,
238238
LoopInfo *LI, DominatorTree *DT, IRBuilderBase &Builder,
239-
InnerLoopVectorizer *ILV, VPlan *Plan);
239+
InnerLoopVectorizer *ILV, VPlan *Plan, Type *CanonicalIVTy);
240240
/// Target Transform Info.
241241
const TargetTransformInfo *TTI;
242242

0 commit comments

Comments
 (0)