diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-10 23:38:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-10 23:38:52 +0000 |
commit | de2b6605ba42a3d7ccbe75e773a1f910884faa3a (patch) | |
tree | 4f17d67107b39d95e0d7589f920d4e4882931349 /lib/Transforms | |
parent | 7d6d241c11690431d019df64ae07257e64b4f00c (diff) | |
download | external_llvm-de2b6605ba42a3d7ccbe75e773a1f910884faa3a.zip external_llvm-de2b6605ba42a3d7ccbe75e773a1f910884faa3a.tar.gz external_llvm-de2b6605ba42a3d7ccbe75e773a1f910884faa3a.tar.bz2 |
Fix InstCombine/2006-11-10-ashr-miscompile.ll a miscompilation introduced
by the shr -> [al]shr patch. This was reduced from 176.gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31653 91177308-0d34-0410-b5e6-96231b3b80d8
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. |