aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-28 19:47:20 +0000
committerChris Lattner <sabre@nondot.org>2006-02-28 19:47:20 +0000
commit06e1e253683a3e4b783bd449e44c6dd5ed5d4aa3 (patch)
tree8b6248cd53ea34b3cceb5f50280e43c94d55ef78
parentf949c1ad6cbd8375ceae91c89d59522b013aed3b (diff)
Fix a regression in a patch from a couple of days ago. This fixes
Transforms/InstCombine/2006-02-28-Crash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26427 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 63de8fa222..645120510e 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/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);