summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2016-05-02 01:53:30 +0000
committerCraig Topper <craig.topper@gmail.com>2016-05-02 01:53:30 +0000
commite3c1e225d7581a15a8c1ef766ef958386b24c850 (patch)
tree8f0aa4f6a2c7fd9ddc0677d38fa5777f3561c648 /llvm/utils/TableGen
parent6eec8d6c6f2c179ecea70087bf5f5dff3052dd4b (diff)
downloadbcm5719-llvm-e3c1e225d7581a15a8c1ef766ef958386b24c850.tar.gz
bcm5719-llvm-e3c1e225d7581a15a8c1ef766ef958386b24c850.zip
[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
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherEmitter.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
index 4f944beaa50..28473996a5c 100644
--- a/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
@@ -247,9 +247,16 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
OS << "OPC_CaptureGlueInput,\n";
return 1;
- case Matcher::MoveChild:
- OS << "OPC_MoveChild, " << cast<MoveChildMatcher>(N)->getChildNo() << ",\n";
- return 2;
+ case Matcher::MoveChild: {
+ const auto *MCM = cast<MoveChildMatcher>(N);
+
+ 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:
OS << "OPC_MoveParent,\n";
OpenPOWER on IntegriCloud