diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-02 05:29:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-02 05:29:55 +0000 |
commit | 0737c24053d88d47a1c5dc560dc97da49c1076ae (patch) | |
tree | fa2a28f6be61e3cd351d83c6b98096c30e540851 | |
parent | 2d1222c060f56909c57c7828b6cad6a3e25017e2 (diff) |
bugfix for reid's shift patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33779 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4aa92ec6d4..0306c3919b 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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; } } |