summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorWhitney Tsang <whitney.uwaterloo@gmail.com>2019-06-17 14:38:56 +0000
committerWhitney Tsang <whitney.uwaterloo@gmail.com>2019-06-17 14:38:56 +0000
commit15b7f5b72d2ae3dae37a42caa8d3259cfafc70c6 (patch)
treefdc3c71b9334ee77ede0ec010ac2269a03d24651 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent1c91e63897d8832a7b634d9662b8dbcc3ba36efd (diff)
downloadbcm5719-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.cpp3
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
OpenPOWER on IntegriCloud