diff options
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 65ebf64..f636442 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -5082,10 +5082,10 @@ Instruction *InstCombiner::visitShiftInst(ShiftInst &I) { return ReplaceInstUsesWith(I, Op0); // X >>s undef -> X } - // shr int -1, X = -1 (for any arithmetic shift rights of ~0) - if (!isLeftShift) + // ashr int -1, X = -1 (for any arithmetic shift rights of ~0) + if (I.getOpcode() == Instruction::AShr) if (ConstantInt *CSI = dyn_cast<ConstantInt>(Op0)) - if (CSI->isAllOnesValue() && Op0->getType()->isSigned()) + if (CSI->isAllOnesValue()) return ReplaceInstUsesWith(I, CSI); // Try to fold constant and into select arguments. |