@@ -1353,7 +1353,9 @@ void VPlanTransforms::addActiveLaneMask(
1353
1353
// / Replace recipes with their EVL variants.
1354
1354
static void transformRecipestoEVLRecipes (VPlan &Plan, VPValue &EVL) {
1355
1355
using namespace llvm ::VPlanPatternMatch;
1356
- LLVMContext &Ctx = Plan.getCanonicalIV ()->getScalarType ()->getContext ();
1356
+ Type *CanonicalIVType = Plan.getCanonicalIV ()->getScalarType ();
1357
+ VPTypeAnalysis TypeInfo (CanonicalIVType);
1358
+ LLVMContext &Ctx = CanonicalIVType->getContext ();
1357
1359
SmallVector<VPValue *> HeaderMasks = collectAllHeaderMasks (Plan);
1358
1360
VPTypeAnalysis TypeInfo (Plan.getCanonicalIV ()->getScalarType ());
1359
1361
for (VPValue *HeaderMask : collectAllHeaderMasks (Plan)) {
@@ -1403,9 +1405,9 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
1403
1405
// limited to selects whose condition is a header mask.
1404
1406
VPValue *AllTrue =
1405
1407
Plan.getOrAddLiveIn (ConstantInt::getTrue (Ctx));
1406
- return new VPInstruction (VPInstruction::MergeUntilPivot,
1407
- {AllTrue, LHS, RHS, &EVL},
1408
- VPI->getDebugLoc ());
1408
+ return new VPWidenIntrinsicRecipe (
1409
+ Intrinsic::vp_merge, {AllTrue, LHS, RHS, &EVL},
1410
+ TypeInfo. inferScalarType (LHS), VPI->getDebugLoc ());
1409
1411
})
1410
1412
.Default ([&](VPRecipeBase *R) { return nullptr ; });
1411
1413
0 commit comments