diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-05-05 18:59:39 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-05-05 18:59:39 +0000 |
commit | 1a1b92217787842d06a1d9d68529763a11338a47 (patch) | |
tree | 21dc89c1be69f21baf8f5565e4a769606e7c948b /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | e3b1d82b5302102c17ea465ca609cde2a49da314 (diff) | |
download | bcm5719-llvm-1a1b92217787842d06a1d9d68529763a11338a47.tar.gz bcm5719-llvm-1a1b92217787842d06a1d9d68529763a11338a47.zip |
[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
llvm-svn: 359996
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index aa57748ffa7..355455a6146 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -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()) { |