diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-05 04:09:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-05 04:09:35 +0000 |
commit | 0a28e90f2c4cfac473fbf2f4094e62215d3f31cc (patch) | |
tree | 68d99da958e5bce4b90d80689c43f45c2a84e9ca /llvm | |
parent | 4e76c3a482ccbedcb30d75555b45038cab53733e (diff) | |
download | bcm5719-llvm-0a28e90f2c4cfac473fbf2f4094e62215d3f31cc.tar.gz bcm5719-llvm-0a28e90f2c4cfac473fbf2f4094e62215d3f31cc.zip |
fix a miscompilation of 176.gcc
llvm-svn: 33900
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index ab1ea57d6da..80b84afd237 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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. |