Fix a regression in a patch from a couple of days ago. This fixes

Transforms/InstCombine/2006-02-28-Crash.ll

llvm-svn: 26427
This commit is contained in:
Chris Lattner 2006-02-28 19:47:20 +00:00
parent 8c5f04d212
commit c5b6c9a12a
1 changed files with 3 additions and 1 deletions

View File

@ -4818,7 +4818,9 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
if (Op1CV && (Op1CV != (KnownZero^TypeMask))) {
// (X&4) == 2 --> false
// (X&4) != 2 --> true
return ReplaceInstUsesWith(CI, ConstantBool::get(isSetNE));
Constant *Res = ConstantBool::get(isSetNE);
Res = ConstantExpr::getCast(Res, CI.getType());
return ReplaceInstUsesWith(CI, Res);
}
unsigned ShiftAmt = Log2_64(KnownZero^TypeMask);