mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Teach instsimplify some tricks about exact/nuw/nsw shifts.
improve interfaces to instsimplify to take this info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -617,13 +617,16 @@ Instruction *InstCombiner::FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
|
||||
}
|
||||
|
||||
Instruction *InstCombiner::visitShl(BinaryOperator &I) {
|
||||
if (Value *V = SimplifyShlInst(I.getOperand(0), I.getOperand(1), TD))
|
||||
if (Value *V = SimplifyShlInst(I.getOperand(0), I.getOperand(1),
|
||||
I.hasNoSignedWrap(), I.hasNoUnsignedWrap(),
|
||||
TD))
|
||||
return ReplaceInstUsesWith(I, V);
|
||||
return commonShiftTransforms(I);
|
||||
}
|
||||
|
||||
Instruction *InstCombiner::visitLShr(BinaryOperator &I) {
|
||||
if (Value *V = SimplifyLShrInst(I.getOperand(0), I.getOperand(1), TD))
|
||||
if (Value *V = SimplifyLShrInst(I.getOperand(0), I.getOperand(1),
|
||||
I.isExact(), TD))
|
||||
return ReplaceInstUsesWith(I, V);
|
||||
|
||||
if (Instruction *R = commonShiftTransforms(I))
|
||||
@@ -652,7 +655,8 @@ Instruction *InstCombiner::visitLShr(BinaryOperator &I) {
|
||||
}
|
||||
|
||||
Instruction *InstCombiner::visitAShr(BinaryOperator &I) {
|
||||
if (Value *V = SimplifyAShrInst(I.getOperand(0), I.getOperand(1), TD))
|
||||
if (Value *V = SimplifyAShrInst(I.getOperand(0), I.getOperand(1),
|
||||
I.isExact(), TD))
|
||||
return ReplaceInstUsesWith(I, V);
|
||||
|
||||
if (Instruction *R = commonShiftTransforms(I))
|
||||
|
Reference in New Issue
Block a user