mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-27 17:31:33 +00:00
generalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34910 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91153686f0
commit
bcf2484450
@ -757,8 +757,10 @@ SDOperand DAGCombiner::visitADDC(SDNode *N) {
|
|||||||
SDOperand(N, 1));
|
SDOperand(N, 1));
|
||||||
|
|
||||||
// canonicalize constant to RHS.
|
// canonicalize constant to RHS.
|
||||||
if (N0C && !N1C)
|
if (N0C && !N1C) {
|
||||||
return DAG.getNode(ISD::ADDC, VT, N1, N0);
|
SDOperand Ops[] = { N1, N0 };
|
||||||
|
return DAG.getNode(ISD::ADDC, N->getVTList(), Ops, 2);
|
||||||
|
}
|
||||||
|
|
||||||
// fold (add x, 0) -> x + no carry out
|
// fold (add x, 0) -> x + no carry out
|
||||||
//if (N1C && N1C->isNullValue())
|
//if (N1C && N1C->isNullValue())
|
||||||
@ -772,11 +774,13 @@ SDOperand DAGCombiner::visitADDE(SDNode *N) {
|
|||||||
SDOperand N1 = N->getOperand(1);
|
SDOperand N1 = N->getOperand(1);
|
||||||
ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
|
ConstantSDNode *N0C = dyn_cast<ConstantSDNode>(N0);
|
||||||
ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
|
ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
|
||||||
MVT::ValueType VT = N0.getValueType();
|
//MVT::ValueType VT = N0.getValueType();
|
||||||
|
|
||||||
// canonicalize constant to RHS
|
// canonicalize constant to RHS
|
||||||
if (N0C && !N1C)
|
if (N0C && !N1C) {
|
||||||
return DAG.getNode(ISD::ADDE, VT, N1, N0, N->getOperand(2));
|
SDOperand Ops[] = { N1, N0, N->getOperand(2) };
|
||||||
|
return DAG.getNode(ISD::ADDE, N->getVTList(), Ops, 3);
|
||||||
|
}
|
||||||
|
|
||||||
// fold (add x, 0) -> x
|
// fold (add x, 0) -> x
|
||||||
//if (N1C && N1C->isNullValue())
|
//if (N1C && N1C->isNullValue())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user