mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
bugfix for reid's shift patch.
llvm-svn: 33779
This commit is contained in:
parent
63479262b4
commit
1f032e74ae
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user