[NFCI][SimplifyCFG] simplifyReturn(): use DeleteDeadBlock()

This commit is contained in:
Roman Lebedev 2021-05-19 11:50:06 +03:00
parent 00f90e3fca
commit 69a43e5fc5
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 2 additions and 7 deletions

View File

@ -4645,13 +4645,8 @@ bool SimplifyCFGOpt::simplifyReturn(ReturnInst *RI, IRBuilder<> &Builder) {
}
// If we eliminated all predecessors of the block, delete the block now.
if (pred_empty(BB)) {
// We know there are no successors, so just nuke the block.
if (DTU)
DTU->deleteBB(BB);
else
BB->eraseFromParent();
}
if (pred_empty(BB))
DeleteDeadBlock(BB, DTU);
return true;
}