@@ -1350,7 +1350,8 @@ void VPlanTransforms::addActiveLaneMask(
13501350}
13511351
13521352// / Replace recipes with their EVL variants.
1353- static void transformRecipestoEVLRecipes (VPlan &Plan, VPValue &EVL) {
1353+ static void transformRecipestoEVLRecipes (VPlan &Plan, VPValue &EVL,
1354+ LLVMContext &Ctx) {
13541355 using namespace llvm ::VPlanPatternMatch;
13551356 SmallVector<VPValue *> HeaderMasks = collectAllHeaderMasks (Plan);
13561357 for (VPValue *HeaderMask : collectAllHeaderMasks (Plan)) {
@@ -1384,15 +1385,14 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
13841385 VPValue *NewMask = GetNewMask (Red->getCondOp ());
13851386 return new VPReductionEVLRecipe (*Red, EVL, NewMask);
13861387 })
1387- .Case <VPInstruction>([&](VPInstruction *VPI) {
1388+ .Case <VPInstruction>([&](VPInstruction *VPI) -> VPRecipeBase * {
13881389 VPValue *LHS, *RHS;
13891390 if (!match (VPI, m_Select (m_Specific (HeaderMask), m_VPValue (LHS),
13901391 m_VPValue (RHS))))
13911392 return nullptr ;
1392- VPValue *Cond = Plan.getOrAddLiveIn (ConstantInt::getTrue (
1393- CanonicalIVPHI->getScalarType ()->getContext ()));
1393+ VPValue *Cond = Plan.getOrAddLiveIn (ConstantInt::getTrue (Ctx));
13941394 return new VPInstruction (VPInstruction::MergeUntilPivot,
1395- {Cond, LHS, RHS, EVL},
1395+ {Cond, LHS, RHS, & EVL},
13961396 VPI->getDebugLoc ());
13971397 })
13981398 .Default ([&](VPRecipeBase *R) { return nullptr ; });
@@ -1486,7 +1486,8 @@ bool VPlanTransforms::tryAddExplicitVectorLength(VPlan &Plan) {
14861486 NextEVLIV->insertBefore (CanonicalIVIncrement);
14871487 EVLPhi->addOperand (NextEVLIV);
14881488
1489- transformRecipestoEVLRecipes (Plan, *VPEVL);
1489+ LLVMContext &Ctx = CanonicalIVPHI->getScalarType ()->getContext ();
1490+ transformRecipestoEVLRecipes (Plan, *VPEVL, Ctx);
14901491
14911492 // Replace all uses of VPCanonicalIVPHIRecipe by
14921493 // VPEVLBasedIVPHIRecipe except for the canonical IV increment.
0 commit comments