diff options
author | Whitney Tsang <whitney.uwaterloo@gmail.com> | 2019-06-17 14:38:56 +0000 |
---|---|---|
committer | Whitney Tsang <whitney.uwaterloo@gmail.com> | 2019-06-17 14:38:56 +0000 |
commit | 15b7f5b72d2ae3dae37a42caa8d3259cfafc70c6 (patch) | |
tree | fdc3c71b9334ee77ede0ec010ac2269a03d24651 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 1c91e63897d8832a7b634d9662b8dbcc3ba36efd (diff) | |
download | bcm5719-llvm-15b7f5b72d2ae3dae37a42caa8d3259cfafc70c6.tar.gz bcm5719-llvm-15b7f5b72d2ae3dae37a42caa8d3259cfafc70c6.zip |
PHINode: introduce setIncomingValueForBlock() function, and use it.
Summary:
There is PHINode::getBasicBlockIndex() and PHINode::setIncomingValue()
but no function to replace incoming value for a specified BasicBlock*
predecessor.
Clearly, there are a lot of places that could use that functionality.
Reviewer: craig.topper, lebedev.ri, Meinersbur, kbarton, fhahn
Reviewed By: Meinersbur, fhahn
Subscribers: fhahn, hiraditya, zzheng, jsji, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D63338
llvm-svn: 363566
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index f571aa6bf2e..91c645bcf92 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -2826,8 +2826,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, MemorySSAUpdater *MSSAU, } } // Update PHI Node. - PHIs[i]->setIncomingValue(PHIs[i]->getBasicBlockIndex(PBI->getParent()), - MergedCond); + PHIs[i]->setIncomingValueForBlock(PBI->getParent(), MergedCond); } // PBI is changed to branch to TrueDest below. Remove itself from |