@@ -8713,7 +8713,7 @@ static SetVector<VPIRInstruction *> collectUsersInExitBlock(
8713
8713
// Add exit values to \p Plan. Extracts are added for each entry in \p
8714
8714
// ExitUsersToFix if needed and their operands are updated.
8715
8715
static void
8716
- addUsersInExitBlock (VPlan &Plan, LLVMContext &Ctx,
8716
+ addUsersInExitBlock (VPlan &Plan,
8717
8717
const SetVector<VPIRInstruction *> &ExitUsersToFix) {
8718
8718
if (ExitUsersToFix.empty ())
8719
8719
return ;
@@ -8730,6 +8730,7 @@ addUsersInExitBlock(VPlan &Plan, LLVMContext &Ctx,
8730
8730
if (V->isLiveIn ())
8731
8731
continue ;
8732
8732
8733
+ LLVMContext &Ctx = ExitIRI->getInstruction ().getContext ();
8733
8734
VPValue *Ext = B.createNaryOp (VPInstruction::ExtractFromEnd,
8734
8735
{V, Plan.getOrAddLiveIn (ConstantInt::get (
8735
8736
IntegerType::get (Ctx, 32 ), 1 ))});
@@ -8895,10 +8896,9 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
8895
8896
return !CM.requiresScalarEpilogue (VF.isVector ());
8896
8897
},
8897
8898
Range);
8898
- Type *WidestIndTy = Legal->getWidestInductionType ();
8899
- VPlanPtr Plan =
8900
- VPlan::createInitialVPlan (WidestIndTy, PSE, RequiresScalarEpilogueCheck,
8901
- CM.foldTailByMasking (), OrigLoop);
8899
+ VPlanPtr Plan = VPlan::createInitialVPlan (Legal->getWidestInductionType (),
8900
+ PSE, RequiresScalarEpilogueCheck,
8901
+ CM.foldTailByMasking (), OrigLoop);
8902
8902
8903
8903
// Don't use getDecisionAndClampRange here, because we don't know the UF
8904
8904
// so this function is better to be conservative, rather than to split
@@ -8913,7 +8913,7 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
8913
8913
// When not folding the tail, we know that the induction increment will not
8914
8914
// overflow.
8915
8915
bool HasNUW = Style == TailFoldingStyle::None;
8916
- addCanonicalIVRecipes (*Plan, WidestIndTy , HasNUW, DL);
8916
+ addCanonicalIVRecipes (*Plan, Legal-> getWidestInductionType () , HasNUW, DL);
8917
8917
8918
8918
VPRecipeBuilder RecipeBuilder (*Plan, OrigLoop, TLI, Legal, CM, PSE, Builder);
8919
8919
@@ -9045,7 +9045,7 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
9045
9045
SetVector<VPIRInstruction *> ExitUsersToFix = collectUsersInExitBlock (
9046
9046
OrigLoop, RecipeBuilder, *Plan, Legal->getInductionVars ());
9047
9047
addLiveOutsForFirstOrderRecurrences (*Plan, ExitUsersToFix);
9048
- addUsersInExitBlock (*Plan, WidestIndTy-> getContext (), ExitUsersToFix);
9048
+ addUsersInExitBlock (*Plan, ExitUsersToFix);
9049
9049
9050
9050
// ---------------------------------------------------------------------------
9051
9051
// Transform initial VPlan: Apply previously taken decisions, in order, to
0 commit comments