Skip to content

Commit 0e261f3

Browse files
committed
Use recursivelyDeleteDeadRecipes to clear header masks
1 parent 3638810 commit 0e261f3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,11 +1573,12 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
15731573
}
15741574
}
15751575

1576-
for (VPRecipeBase *R : ToErase)
1576+
for (VPRecipeBase *R : reverse(ToErase)) {
1577+
SmallVector<VPValue *> PossiblyDead(R->operands());
15771578
R->eraseFromParent();
1578-
1579-
for (VPValue *HeaderMask : collectAllHeaderMasks(Plan))
1580-
recursivelyDeleteDeadRecipes(HeaderMask);
1579+
for (VPValue *Op : PossiblyDead)
1580+
recursivelyDeleteDeadRecipes(Op);
1581+
}
15811582
}
15821583

15831584
/// Add a VPEVLBasedIVPHIRecipe and related recipes to \p Plan and

0 commit comments

Comments
 (0)