[llvm] r262815 - [CodeGen] Add space-optimized EmitMergeInputChains1_2 to the DAG isel matching tables. Shaves about 5100 bytes from the X86 matcher table. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 6 23:29:12 PST 2016
Author: ctopper
Date: Mon Mar 7 01:29:12 2016
New Revision: 262815
URL: http://llvm.org/viewvc/llvm-project?rev=262815&view=rev
Log:
[CodeGen] Add space-optimized EmitMergeInputChains1_2 to the DAG isel matching tables. Shaves about 5100 bytes from the X86 matcher table. NFC
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=262815&r1=262814&r2=262815&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon Mar 7 01:29:12 2016
@@ -140,6 +140,7 @@ public:
OPC_EmitMergeInputChains,
OPC_EmitMergeInputChains1_0,
OPC_EmitMergeInputChains1_1,
+ OPC_EmitMergeInputChains1_2,
OPC_EmitCopyToReg,
OPC_EmitNodeXForm,
OPC_EmitNode,
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=262815&r1=262814&r2=262815&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon Mar 7 01:29:12 2016
@@ -3051,7 +3051,8 @@ SelectCodeCommon(SDNode *NodeToMatch, co
}
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, co
"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());
Modified: llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp?rev=262815&r1=262814&r2=262815&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelMatcherEmitter.cpp Mon Mar 7 01:29:12 2016
@@ -500,8 +500,8 @@ EmitMatcher(const Matcher *N, unsigned I
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;
}
More information about the llvm-commits
mailing list