diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2005-11-02 18:35:40 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2005-11-02 18:35:40 +0000 |
commit | 7bbff04f7f1d0c16a464eb074a3e5e8f729b97e3 (patch) | |
tree | 1dfaad23acad67f71e421f710cfc481d5cc8ff62 | |
parent | e8148bc29113ca9f9266d35c450a82ee1be84e52 (diff) |
make this 64 bit clean, fixed test30 of /Regression/Transforms/InstCombine/add.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24158 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index adafccddf0..1db2df2506 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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); } |