aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-11 18:39:58 +0000
committerChris Lattner <sabre@nondot.org>2009-10-11 18:39:58 +0000
commit59be447db438daefb7cdc64feeb2595f474f0be8 (patch)
tree9b50fc5a73451b253060db85f5e36bbe593a8cf1 /lib/Transforms
parent2c50edbc5a7493d03d1561eeb139a316b582b65d (diff)
downloadexternal_llvm-59be447db438daefb7cdc64feeb2595f474f0be8.zip
external_llvm-59be447db438daefb7cdc64feeb2595f474f0be8.tar.gz
external_llvm-59be447db438daefb7cdc64feeb2595f474f0be8.tar.bz2
when folding duplicate conditions, delete the
now-probably-dead instruction tree feeding it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/JumpThreading.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index 210d6ef..8b11edd 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -450,9 +450,11 @@ bool JumpThreading::ProcessBranchOnDuplicateCond(BasicBlock *PredBB,
<< "' folding condition to '" << BranchDir << "': "
<< *BB->getTerminator() << '\n');
++NumFolds;
+ Value *OldCond = DestBI->getCondition();
DestBI->setCondition(ConstantInt::get(Type::getInt1Ty(BB->getContext()),
BranchDir));
ConstantFoldTerminator(BB);
+ RecursivelyDeleteTriviallyDeadInstructions(OldCond);
return true;
}