forked from OSchip/llvm-project
[CodeGen] Add space-optimized EmitMergeInputChains1_2 to the DAG isel matching tables. Shaves about 5100 bytes from the X86 matcher table. NFC
llvm-svn: 262815
This commit is contained in:
parent
67a1830c6a
commit
267bdb2094
|
@ -140,6 +140,7 @@ public:
|
|||
OPC_EmitMergeInputChains,
|
||||
OPC_EmitMergeInputChains1_0,
|
||||
OPC_EmitMergeInputChains1_1,
|
||||
OPC_EmitMergeInputChains1_2,
|
||||
OPC_EmitCopyToReg,
|
||||
OPC_EmitNodeXForm,
|
||||
OPC_EmitNode,
|
||||
|
|
|
@ -3051,7 +3051,8 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
|
|||
}
|
||||
|
||||
case OPC_EmitMergeInputChains1_0: // OPC_EmitMergeInputChains, 1, 0
|
||||
case OPC_EmitMergeInputChains1_1: { // OPC_EmitMergeInputChains, 1, 1
|
||||
case OPC_EmitMergeInputChains1_1: // OPC_EmitMergeInputChains, 1, 1
|
||||
case OPC_EmitMergeInputChains1_2: { // OPC_EmitMergeInputChains, 1, 2
|
||||
// These are space-optimized forms of OPC_EmitMergeInputChains.
|
||||
assert(!InputChain.getNode() &&
|
||||
"EmitMergeInputChains should be the first chain producing node");
|
||||
|
@ -3059,7 +3060,7 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
|
|||
"Should only have one EmitMergeInputChains per match");
|
||||
|
||||
// Read all of the chained nodes.
|
||||
unsigned RecNo = Opcode == OPC_EmitMergeInputChains1_1;
|
||||
unsigned RecNo = Opcode - OPC_EmitMergeInputChains1_0;
|
||||
assert(RecNo < RecordedNodes.size() && "Invalid EmitMergeInputChains");
|
||||
ChainNodesMatched.push_back(RecordedNodes[RecNo].first.getNode());
|
||||
|
||||
|
|
|
@ -500,8 +500,8 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
|
|||
const EmitMergeInputChainsMatcher *MN =
|
||||
cast<EmitMergeInputChainsMatcher>(N);
|
||||
|
||||
// Handle the specialized forms OPC_EmitMergeInputChains1_0 and 1_1.
|
||||
if (MN->getNumNodes() == 1 && MN->getNode(0) < 2) {
|
||||
// Handle the specialized forms OPC_EmitMergeInputChains1_0, 1_1, and 1_2.
|
||||
if (MN->getNumNodes() == 1 && MN->getNode(0) < 3) {
|
||||
OS << "OPC_EmitMergeInputChains1_" << MN->getNode(0) << ",\n";
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue