1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

bugfix for reid's shift patch.

llvm-svn: 33779
This commit is contained in:
Chris Lattner 2007-02-02 05:29:55 +00:00
parent 63479262b4
commit 1f032e74ae

View File

@ -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;
}
}