summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-02 05:29:55 +0000
committerChris Lattner <sabre@nondot.org>2007-02-02 05:29:55 +0000
commitd5fea61d985df3fdb0e0fc4de51212bf5bd7ccbd (patch)
tree4a76287754911a42aa6709f3e3b90080de8300e4
parent2d5b4ac38f82bd06ffced08f81a25aa84bf49b65 (diff)
downloadbcm5719-llvm-d5fea61d985df3fdb0e0fc4de51212bf5bd7ccbd.tar.gz
bcm5719-llvm-d5fea61d985df3fdb0e0fc4de51212bf5bd7ccbd.zip
bugfix for reid's shift patch.
llvm-svn: 33779
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 4aa92ec6d4f..0306c3919bd 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -5454,10 +5454,10 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
//
unsigned TypeBits = Op0->getType()->getPrimitiveSizeInBits();
if (Op1->getZExtValue() >= TypeBits) {
- if (isUnsignedShift || isLeftShift)
+ if (I.getOpcode() != Instruction::AShr)
return ReplaceInstUsesWith(I, Constant::getNullValue(Op0->getType()));
else {
- I.setOperand(1, ConstantInt::get(Type::Int8Ty, TypeBits-1));
+ I.setOperand(1, ConstantInt::get(I.getType(), TypeBits-1));
return &I;
}
}
OpenPOWER on IntegriCloud