[PATCH] D77035: [Coroutines] Simplify implementation using removePredecessor
JunMa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 29 23:02:07 PDT 2020
junparser created this revision.
junparser added a reviewer: modocache.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
As the title says, this is just a minor update using existed api to simplify the code
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77035
Files:
llvm/lib/Transforms/Coroutines/CoroSplit.cpp
Index: llvm/lib/Transforms/Coroutines/CoroSplit.cpp
===================================================================
--- llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -941,11 +941,7 @@
// 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77035.253497.patch
Type: text/x-patch
Size: 779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200330/e371a98e/attachment-0001.bin>
More information about the llvm-commits
mailing list