mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
Make legalize a bit more efficient, and canonicalize sub X, C -> add X, -C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21882 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -323,8 +323,11 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
// There is no need to legalize the size argument (Operand #1)
|
||||
if (Tmp1 != Node->getOperand(0))
|
||||
Result = DAG.getNode(Node->getOpcode(), MVT::Other, Tmp1,
|
||||
Node->getOperand(1));
|
||||
Node->setAdjCallChain(Tmp1);
|
||||
// Note that we do not create new ADJCALLSTACK DOWN/UP nodes here. These
|
||||
// nodes are treated specially and are mutated in place. This makes the dag
|
||||
// legalization process more efficient and also makes libcall insertion
|
||||
// easier.
|
||||
break;
|
||||
case ISD::DYNAMIC_STACKALLOC:
|
||||
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
|
||||
|
||||
Reference in New Issue
Block a user