summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-03-24 04:52:04 +0000
committerCameron Zwarich <zwarich@apple.com>2011-03-24 04:52:04 +0000
commitdd84bcce8f305901c4863a19a3ada87af3f18ab5 (patch)
treea1384c6fa7b24830217a20893407af748a306c21 /llvm/lib
parent47e7175fe9e85eb26b086ae027aa0ebf15a1f1e4 (diff)
downloadbcm5719-llvm-dd84bcce8f305901c4863a19a3ada87af3f18ab5.tar.gz
bcm5719-llvm-dd84bcce8f305901c4863a19a3ada87af3f18ab5.zip
When UpdateDT is set, DT is invalid, which could cause problems when trying to
use it later. I couldn't make a test that hits this with the current code. llvm-svn: 128195
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index 604e791e27c..75ac4d81af7 100644
--- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -331,7 +331,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
// The PHIs are now updated, change everything that refers to BB to use
// DestBB and remove BB.
BB->replaceAllUsesWith(DestBB);
- if (DT) {
+ if (DT && !UpdateDT) {
BasicBlock *BBIDom = DT->getNode(BB)->getIDom()->getBlock();
BasicBlock *DestBBIDom = DT->getNode(DestBB)->getIDom()->getBlock();
BasicBlock *NewIDom = DT->findNearestCommonDominator(BBIDom, DestBBIDom);
@@ -534,7 +534,8 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) {
// happens.
WeakVH IterHandle(CurInstIterator);
- ReplaceAndSimplifyAllUses(CI, RetVal, TLI ? TLI->getTargetData() : 0, DT);
+ ReplaceAndSimplifyAllUses(CI, RetVal, TLI ? TLI->getTargetData() : 0,
+ UpdateDT ? 0 : DT);
// If the iterator instruction was recursively deleted, start over at the
// start of the block.
OpenPOWER on IntegriCloud