summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-10 23:38:52 +0000
committerChris Lattner <sabre@nondot.org>2006-11-10 23:38:52 +0000
commitd4dee405cbe030806fec016499e9e90d55062a55 (patch)
tree78dc67a952f16867c9622d78c892aaff475c2627 /llvm/lib
parentd530a503dabae82c6214a4ae5155e351eb4c44af (diff)
downloadbcm5719-llvm-d4dee405cbe030806fec016499e9e90d55062a55.tar.gz
bcm5719-llvm-d4dee405cbe030806fec016499e9e90d55062a55.zip
Fix InstCombine/2006-11-10-ashr-miscompile.ll a miscompilation introduced
by the shr -> [al]shr patch. This was reduced from 176.gcc. llvm-svn: 31653
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 65ebf641d6f..f636442bb7f 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud