aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-05 04:09:35 +0000
committerChris Lattner <sabre@nondot.org>2007-02-05 04:09:35 +0000
commit4f3ebab1723edb1c839c5cb632ecce9517349010 (patch)
treea931adf7f375319e5e5dc9ccd5e9e0294f47f616 /lib
parent1853da3f2223ec8e3628df00942a2b2d7b58fd62 (diff)
fix a miscompilation of 176.gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index ab1ea57d6d..80b84afd23 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5647,12 +5647,12 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
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.