1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[Coroutines] Simplify implementation using removePredecessor

Differential Revision: https://reviews.llvm.org/D77035
This commit is contained in:
Jun Ma 2020-04-03 09:20:07 +08:00
parent 7db103f3ff
commit c5c5d9a37e

View File

@ -941,11 +941,7 @@ static bool simplifyTerminatorLeadingToRet(Instruction *InitialInst) {
// If InitialInst is an unconditional branch,
// remove PHI values that come from basic block of InitialInst
if (UnconditionalSucc)
for (PHINode &PN : UnconditionalSucc->phis()) {
int idx = PN.getBasicBlockIndex(InitialInst->getParent());
if (idx != -1)
PN.removeIncomingValue(idx);
}
UnconditionalSucc->removePredecessor(InitialInst->getParent(), true);
ReplaceInstWithInst(InitialInst, I->clone());
}
return true;