summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2005-11-02 18:35:40 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2005-11-02 18:35:40 +0000
commit662295587dd9eee3beecc15f0df7da3c6ea74d81 (patch)
tree28e6dc039e903253711d1d7f3b73e80974df5ee8 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent8426ee14bef88de90bde8efeb399fedd6bc03b0d (diff)
downloadbcm5719-llvm-662295587dd9eee3beecc15f0df7da3c6ea74d81.tar.gz
bcm5719-llvm-662295587dd9eee3beecc15f0df7da3c6ea74d81.zip
make this 64 bit clean, fixed test30 of /Regression/Transforms/InstCombine/add.ll
llvm-svn: 24158
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index adafccddf00..1db2df25068 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -710,7 +710,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
// 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);
}
OpenPOWER on IntegriCloud