mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley
Evans! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93884 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1751,6 +1751,11 @@ Instruction *InstCombiner::visitXor(BinaryOperator &I) {
|
||||
return BinaryOperator::CreateOr(NotX, NotY);
|
||||
return BinaryOperator::CreateAnd(NotX, NotY);
|
||||
}
|
||||
|
||||
} else if (Op0I->getOpcode() == Instruction::AShr) {
|
||||
// ~(~X >>s Y) --> (X >>s Y)
|
||||
if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0)))
|
||||
return BinaryOperator::CreateAShr(Op0NotVal, Op0I->getOperand(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user