mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[NFC] BasicBlock: refactor changePhiUses() out of replacePhiUsesWith(), use it
Summary: It is a common thing to loop over every `PHINode` in some `BasicBlock` and change old `BasicBlock` incoming block to a new `BasicBlock` incoming block. `replaceSuccessorsPhiUsesWith()` already had code to do that, it just wasn't a function. So outline it into a new function, and use it. Reviewers: chandlerc, craig.topper, spatel, danielcdh Reviewed By: craig.topper Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61013 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359996 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7221,8 +7221,7 @@ bool CodeGenPrepare::splitBranchCondition(Function &F, bool &ModifiedDT) {
|
||||
std::swap(TBB, FBB);
|
||||
|
||||
// Replace the old BB with the new BB.
|
||||
for (PHINode &PN : TBB->phis())
|
||||
PN.replaceIncomingBlockWith(&BB, TmpBB);
|
||||
TBB->replacePhiUsesWith(&BB, TmpBB);
|
||||
|
||||
// Add another incoming edge form the new BB.
|
||||
for (PHINode &PN : FBB->phis()) {
|
||||
|
||||
Reference in New Issue
Block a user