Skip to content

Commit 15770a1

Browse files
committed
[VPlan] Remove dead recipes in entry when merging regions. (NFC)
Also remove recipes in the entry of the region that will be removed. This makes sure we don't leave any dead users around. NFC at the moment, but avoids causing issues in the future.
1 parent aa37a69 commit 15770a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ static bool mergeReplicateRegionsIntoSuccessors(VPlan &Plan) {
290290
Phi1ToMove.moveBefore(*Merge2, Merge2->begin());
291291
}
292292

293+
// Remove the dead recipes in Region1's entry block.
294+
for (VPRecipeBase &R :
295+
make_early_inc_range(reverse(*Region1->getEntryBasicBlock())))
296+
R.eraseFromParent();
297+
293298
// Finally, remove the first region.
294299
for (VPBlockBase *Pred : make_early_inc_range(Region1->getPredecessors())) {
295300
VPBlockUtils::disconnectBlocks(Pred, Region1);

0 commit comments

Comments
 (0)