Skip to content

Commit

Permalink
[Coroutines] Simplify implementation using removePredecessor
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D77035
  • Loading branch information
junparser committed Apr 3, 2020
1 parent aef0877 commit 9c6f32a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions llvm/lib/Transforms/Coroutines/CoroSplit.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 9c6f32a

Please sign in to comment.