mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 02:52:53 +02:00
[CodeGen] Add OPC_MoveChild0-OPC_MoveChild7 opcodes to isel matching tables to optimize table size. Shaves about 12K off the X86 matcher table.
llvm-svn: 268209
This commit is contained in:
parent
4d35211d79
commit
cb85db8903
@ -111,6 +111,8 @@ public:
|
|||||||
OPC_RecordMemRef,
|
OPC_RecordMemRef,
|
||||||
OPC_CaptureGlueInput,
|
OPC_CaptureGlueInput,
|
||||||
OPC_MoveChild,
|
OPC_MoveChild,
|
||||||
|
OPC_MoveChild0, OPC_MoveChild1, OPC_MoveChild2, OPC_MoveChild3,
|
||||||
|
OPC_MoveChild4, OPC_MoveChild5, OPC_MoveChild6, OPC_MoveChild7,
|
||||||
OPC_MoveParent,
|
OPC_MoveParent,
|
||||||
OPC_CheckSame,
|
OPC_CheckSame,
|
||||||
OPC_CheckChild0Same, OPC_CheckChild1Same,
|
OPC_CheckChild0Same, OPC_CheckChild1Same,
|
||||||
|
@ -2971,6 +2971,18 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case OPC_MoveChild0: case OPC_MoveChild1:
|
||||||
|
case OPC_MoveChild2: case OPC_MoveChild3:
|
||||||
|
case OPC_MoveChild4: case OPC_MoveChild5:
|
||||||
|
case OPC_MoveChild6: case OPC_MoveChild7: {
|
||||||
|
unsigned ChildNo = Opcode-OPC_MoveChild0;
|
||||||
|
if (ChildNo >= N.getNumOperands())
|
||||||
|
break; // Match fails if out of range child #.
|
||||||
|
N = N.getOperand(ChildNo);
|
||||||
|
NodeStack.push_back(N);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
case OPC_MoveParent:
|
case OPC_MoveParent:
|
||||||
// Pop the current node off the NodeStack.
|
// Pop the current node off the NodeStack.
|
||||||
NodeStack.pop_back();
|
NodeStack.pop_back();
|
||||||
|
@ -247,9 +247,16 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
|
|||||||
OS << "OPC_CaptureGlueInput,\n";
|
OS << "OPC_CaptureGlueInput,\n";
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case Matcher::MoveChild:
|
case Matcher::MoveChild: {
|
||||||
OS << "OPC_MoveChild, " << cast<MoveChildMatcher>(N)->getChildNo() << ",\n";
|
const auto *MCM = cast<MoveChildMatcher>(N);
|
||||||
return 2;
|
|
||||||
|
OS << "OPC_MoveChild";
|
||||||
|
// Handle the specialized forms.
|
||||||
|
if (MCM->getChildNo() >= 8)
|
||||||
|
OS << ", ";
|
||||||
|
OS << MCM->getChildNo() << ",\n";
|
||||||
|
return (MCM->getChildNo() >= 8) ? 2 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
case Matcher::MoveParent:
|
case Matcher::MoveParent:
|
||||||
OS << "OPC_MoveParent,\n";
|
OS << "OPC_MoveParent,\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user