1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Fix an ugly problem in SCCP. This fixes Benchmarks/Misc-C++/mandel-text.cpp

llvm-svn: 31073
This commit is contained in:
Chris Lattner 2006-10-20 20:19:08 +00:00
parent 38ed7d9e49
commit 6ea0134893

View File

@ -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);
}