From 6734bffe2471786ab0d943f236f6b02bc95084b4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 20 Oct 2006 20:19:08 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/SCCP.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index d1eb8dddda7..0397fc3bd89 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); }