@@ -1351,7 +1351,8 @@ void VPlanTransforms::addActiveLaneMask(
13511351}
13521352
13531353// / Replace recipes with their EVL variants.
1354- static  void  transformRecipestoEVLRecipes (VPlan &Plan, VPValue &EVL) {
1354+ static  void  transformRecipestoEVLRecipes (VPlan &Plan, VPValue &EVL,
1355+                                          LLVMContext &Ctx) {
13551356  using  namespace  llvm ::VPlanPatternMatch; 
13561357  SmallVector<VPValue *> HeaderMasks = collectAllHeaderMasks (Plan);
13571358  VPTypeAnalysis TypeInfo (Plan.getCanonicalIV ()->getScalarType ());
@@ -1393,15 +1394,14 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
13931394                                                  TypeInfo.inferScalarType (Sel),
13941395                                                  false , false , false );
13951396              })
1396-               .Case <VPInstruction>([&](VPInstruction *VPI) {
1397+               .Case <VPInstruction>([&](VPInstruction *VPI) -> VPRecipeBase *  {
13971398                VPValue *LHS, *RHS;
13981399                if  (!match (VPI, m_Select (m_Specific (HeaderMask), m_VPValue (LHS),
13991400                                         m_VPValue (RHS))))
14001401                  return  nullptr ;
1401-                 VPValue *Cond = Plan.getOrAddLiveIn (ConstantInt::getTrue (
1402-                     CanonicalIVPHI->getScalarType ()->getContext ()));
1402+                 VPValue *Cond = Plan.getOrAddLiveIn (ConstantInt::getTrue (Ctx));
14031403                return  new  VPInstruction (VPInstruction::MergeUntilPivot,
1404-                                          {Cond, LHS, RHS, EVL},
1404+                                          {Cond, LHS, RHS, & EVL},
14051405                                         VPI->getDebugLoc ());
14061406              })
14071407              .Default ([&](VPRecipeBase *R) { return  nullptr ; });
@@ -1495,7 +1495,8 @@ bool VPlanTransforms::tryAddExplicitVectorLength(VPlan &Plan) {
14951495  NextEVLIV->insertBefore (CanonicalIVIncrement);
14961496  EVLPhi->addOperand (NextEVLIV);
14971497
1498-   transformRecipestoEVLRecipes (Plan, *VPEVL);
1498+   LLVMContext &Ctx = CanonicalIVPHI->getScalarType ()->getContext ();
1499+   transformRecipestoEVLRecipes (Plan, *VPEVL, Ctx);
14991500
15001501  //  Replace all uses of VPCanonicalIVPHIRecipe by
15011502  //  VPEVLBasedIVPHIRecipe except for the canonical IV increment.
0 commit comments