diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SCCP.cpp | 5 |
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); } |