aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-10-20 20:19:08 +0000
committerChris Lattner <sabre@nondot.org>2006-10-20 20:19:08 +0000
commit6734bffe2471786ab0d943f236f6b02bc95084b4 (patch)
tree0951a3ae8db05379e840e746d0f28c39d64aebaa /lib/Transforms
parent87d8429506998806b9fe74cab7a16963ad4a088e (diff)
Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index d1eb8dddda..0397fc3bd8 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1032,7 +1032,7 @@ bool SCCPSolver::ResolveBranchesIn(Function &F) {
if (BI->isConditional()) {
LatticeVal &BCValue = getValueState(BI->getCondition());
if (BCValue.isUndefined()) {
- BI->setCondition(ConstantBool::getTrue());
+ BCValue.markOverdefined();
BranchesResolved = true;
visit(BI);
}
@@ -1041,7 +1041,8 @@ bool SCCPSolver::ResolveBranchesIn(Function &F) {
LatticeVal &SCValue = getValueState(SI->getCondition());
if (SCValue.isUndefined()) {
const Type *CondTy = SI->getCondition()->getType();
- SI->setCondition(Constant::getNullValue(CondTy));
+ // Pick and arbitrary direction for the switch to go.
+ SCValue.markOverdefined();
BranchesResolved = true;
visit(SI);
}