eliminate some non-obvious casts. UndefValue isa Constant.

llvm-svn: 113113
This commit is contained in:
Chris Lattner 2010-09-05 20:03:09 +00:00
parent eea166dfd4
commit 05ef361b5e
1 changed files with 4 additions and 4 deletions

View File

@ -443,8 +443,8 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){
// Try to use constant folding to simplify the binary operator.
for (unsigned i = 0, e = LHSVals.size(); i != e; ++i) {
Constant *V = LHSVals[i].first ? LHSVals[i].first :
cast<Constant>(UndefValue::get(BO->getType()));
Constant *V = LHSVals[i].first;
if (V == 0) V = UndefValue::get(BO->getType());
Constant *Folded = ConstantExpr::get(BO->getOpcode(), V, CI);
PushConstantIntOrUndef(Result, Folded, LHSVals[i].second);
@ -518,8 +518,8 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){
ComputeValueKnownInPredecessors(I->getOperand(0), BB, LHSVals);
for (unsigned i = 0, e = LHSVals.size(); i != e; ++i) {
Constant *V = LHSVals[i].first ? LHSVals[i].first :
cast<Constant>(UndefValue::get(CmpConst->getType()));
Constant *V = LHSVals[i].first;
if (V == 0) V = UndefValue::get(CmpConst->getType());
Constant *Folded = ConstantExpr::getCompare(Cmp->getPredicate(),
V, CmpConst);
PushConstantIntOrUndef(Result, Folded, LHSVals[i].second);