aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-12 18:30:11 +0000
committerChris Lattner <sabre@nondot.org>2007-01-12 18:30:11 +0000
commit97d1fad3d2e5aac2a89beacc3961ff9451841248 (patch)
treec473b93c9a4c2901e36b092dffd078968903bdde
parentef3baf0979091b873f593c1e214974e488c93b9b (diff)
Branch conditions must be i1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33129 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index 86657c2c0e..bbf5241b34 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1799,10 +1799,8 @@ static bool EvaluateFunction(Function *F, Constant *&RetVal,
} else {
ConstantInt *Cond =
dyn_cast<ConstantInt>(getVal(Values, BI->getCondition()));
+ if (!Cond) return false; // Cannot determine.
- // Cannot determine.
- if (!Cond || Cond->getType() != Type::Int1Ty)
- return false;
NewBB = BI->getSuccessor(!Cond->getZExtValue());
}
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(CurInst)) {