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

Chris Lattner sabre at nondot.org
Sun Feb 4 20:09:51 PST 2007



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.626 -> 1.627
---
Log message:

fix a miscompilation of 176.gcc


---
Diffs of the changes:  (+2 -2)

 InstructionCombining.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.626 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.627
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.626	Sun Feb  4 18:57:54 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Sun Feb  4 22:09:35 2007
@@ -5647,12 +5647,12 @@
     if (ShiftAmt1 == ShiftAmt2) {
       // If we have ((X >>? C) << C), turn this into X & (-1 << C).
       if (I.getOpcode() == Instruction::Shl) {
-        uint64_t Mask = -1ULL << ShiftAmt1;
+        uint64_t Mask = Ty->getBitMask() << ShiftAmt1;
         return BinaryOperator::createAnd(X, ConstantInt::get(Ty, Mask));
       }
       // If we have ((X << C) >>u C), turn this into X & (-1 >>u C).
       if (I.getOpcode() == Instruction::LShr) {
-        uint64_t Mask = -1ULL >> ShiftAmt1;
+        uint64_t Mask = Ty->getBitMask() >> ShiftAmt1;
         return BinaryOperator::createAnd(X, ConstantInt::get(Ty, Mask));
       }
       // We can simplify ((X << C) >>s C) into a trunc + sext.






More information about the llvm-commits mailing list