[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Mar 4 15:21:46 PST 2005
Changes in directory llvm/lib/Transforms/Scalar:
InstructionCombining.cpp updated: 1.315 -> 1.316
---
Log message:
Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the
sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll
---
Diffs of the changes: (+2 -1)
InstructionCombining.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.315 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.316
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.315 Sun Jan 30 23:51:45 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Mar 4 17:21:33 2005
@@ -2563,7 +2563,8 @@
Constant *Mask;
if (CI->getType()->isUnsigned()) {
unsigned TypeBits = CI->getType()->getPrimitiveSize()*8;
- Val &= (1ULL << TypeBits)-1;
+ if (TypeBits != 64)
+ Val &= (1ULL << TypeBits)-1;
Mask = ConstantUInt::get(CI->getType(), Val);
} else {
Mask = ConstantSInt::get(CI->getType(), Val);
More information about the llvm-commits
mailing list