mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
One more transformation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60432 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eccdd08d4c
commit
34d7985927
@ -1025,6 +1025,14 @@ SDValue DAGCombiner::visitADD(SDNode *N) {
|
|||||||
return DAG.getNode(ISD::SUB, VT, N1.getOperand(0),
|
return DAG.getNode(ISD::SUB, VT, N1.getOperand(0),
|
||||||
N1.getOperand(1).getOperand(0));
|
N1.getOperand(1).getOperand(0));
|
||||||
}
|
}
|
||||||
|
// fold (A+((B-A)+-C)) to (B+-C)
|
||||||
|
if ((N1.getOpcode() == ISD::SUB || N1.getOpcode() == ISD::ADD) &&
|
||||||
|
N1.getOperand(0).getOpcode() == ISD::SUB &&
|
||||||
|
N0 == N1.getOperand(0).getOperand(1)) {
|
||||||
|
return DAG.getNode(N1.getOpcode(), VT, N1.getOperand(0).getOperand(0),
|
||||||
|
N1.getOperand(1));
|
||||||
|
}
|
||||||
|
|
||||||
// fold (A-B)+(C-D) to (A+C)-(B+D) when A or C is constant
|
// fold (A-B)+(C-D) to (A+C)-(B+D) when A or C is constant
|
||||||
if (N0.getOpcode() == ISD::SUB && N1.getOpcode() == ISD::SUB) {
|
if (N0.getOpcode() == ISD::SUB && N1.getOpcode() == ISD::SUB) {
|
||||||
SDValue N00 = N0.getOperand(0);
|
SDValue N00 = N0.getOperand(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user