[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 28 11:47:33 PST 2006



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.444 -> 1.445
---
Log message:

Fix a regression in a patch from a couple of days ago.  This fixes
Transforms/InstCombine/2006-02-28-Crash.ll


---
Diffs of the changes:  (+3 -1)

 InstructionCombining.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.444 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.445
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.444	Mon Feb 27 23:49:21 2006
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Tue Feb 28 13:47:20 2006
@@ -4818,7 +4818,9 @@
               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);






More information about the llvm-commits mailing list