diff options
author | Chris Lattner <sabre@nondot.org> | 2006-02-28 19:47:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-02-28 19:47:20 +0000 |
commit | c5b6c9a12a67c4b8c81df8bd6154bc56310e360a (patch) | |
tree | cfa7d4ad147a7638bf0fb339873dcb41bcb39020 /llvm/lib | |
parent | 8c5f04d212a618d7bc3e14b6cc71d69ba026543c (diff) | |
download | bcm5719-llvm-c5b6c9a12a67c4b8c81df8bd6154bc56310e360a.tar.gz bcm5719-llvm-c5b6c9a12a67c4b8c81df8bd6154bc56310e360a.zip |
Fix a regression in a patch from a couple of days ago. This fixes
Transforms/InstCombine/2006-02-28-Crash.ll
llvm-svn: 26427
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 63de8fa2225..645120510ea 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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); |