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

Andrew Lenharth alenhar2 at cs.uiuc.edu
Wed Nov 2 10:35:51 PST 2005



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.402 -> 1.403
---
Log message:

make this 64 bit clean, fixed test30 of /Regression/Transforms/InstCombine/add.ll

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

 InstructionCombining.cpp |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.402 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.403
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.402	Mon Oct 31 12:35:52 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Wed Nov  2 12:35:40 2005
@@ -710,7 +710,7 @@
     // X + (signbit) --> X ^ signbit
     if (ConstantInt *CI = dyn_cast<ConstantInt>(RHSC)) {
       unsigned NumBits = CI->getType()->getPrimitiveSizeInBits();
-      uint64_t Val = CI->getRawValue() & (1ULL << NumBits)-1;
+      uint64_t Val = CI->getRawValue() & (~0ULL >> (64- NumBits));
       if (Val == (1ULL << (NumBits-1)))
         return BinaryOperator::createXor(LHS, RHS);
     }






More information about the llvm-commits mailing list