File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -978,6 +978,16 @@ void VPlan::execute(VPTransformState *State) {
978
978
979
979
// If the original loop is unreachable, delete it and all its blocks.
980
980
if (!ScalarPhVPBB->hasPredecessors ()) {
981
+ // DeleteDeadBlocks will remove single-entry phis. Remove them from the exit
982
+ // VPIRBBs in VPlan as well, otherwise we would retain references to deleted
983
+ // IR instructions.
984
+ for (VPIRBasicBlock *EB : getExitBlocks ()) {
985
+ for (VPRecipeBase &R : make_early_inc_range (EB->phis ())) {
986
+ if (R.getNumOperands () == 1 )
987
+ R.eraseFromParent ();
988
+ }
989
+ }
990
+
981
991
Loop *OrigLoop =
982
992
State->LI ->getLoopFor (getScalarHeader ()->getIRBasicBlock ());
983
993
auto Blocks = OrigLoop->getBlocksVector ();
You can’t perform that action at this time.
0 commit comments