diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-26 17:18:58 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-26 17:18:58 +0000 |
commit | d5e30f0a01971e0aa7bd7c16d8df5b7c391b0a73 (patch) | |
tree | 8ccf4c71b1a5032fcfd62bf47b11fef493f23875 | |
parent | dce8d9cf99bc02589bb4ab1e4c1f8aee9f7c5bbe (diff) |
Get the number of bits to set in a mask correct for a shl/lshr transform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35357 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 586c7b1fb1..78446bc67f 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -5858,7 +5858,7 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1, BinaryOperator::createLShr(X, ConstantInt::get(Ty, ShiftDiff)); InsertNewInstBefore(Shift, I); - APInt Mask(APInt::getLowBitsSet(TypeBits, ShiftAmt2)); + APInt Mask(APInt::getLowBitsSet(TypeBits, TypeBits - ShiftAmt2)); return BinaryOperator::createAnd(Shift, ConstantInt::get(Mask)); } |