summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit319c86fd384bac8c04cd284a4851b11d8e4b8e4c (patch)
treeb9d9f33f772c359cb0fd443b212826305e2d49eb /llvm/lib
parent5dee3b25264c735e7b69fe8b41d43585d8202d9c (diff)
downloadbcm5719-llvm-319c86fd384bac8c04cd284a4851b11d8e4b8e4c.tar.gz
bcm5719-llvm-319c86fd384bac8c04cd284a4851b11d8e4b8e4c.zip
Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cpp
llvm-svn: 31073
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index d1eb8dddda7..0397fc3bd89 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud