summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcherEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-25 06:33:05 +0000
committerChris Lattner <sabre@nondot.org>2010-03-25 06:33:05 +0000
commitd5d5a3dcbaa4e7f394ba045e2d7d0ec3aa76f50c (patch)
treebb650365de89fb8b88c0117974610edeca63f600 /utils/TableGen/DAGISelMatcherEmitter.cpp
parentd4c6c3a7c3140ce487a805138b6f53f82ff6b783 (diff)
downloadllvm-d5d5a3dcbaa4e7f394ba045e2d7d0ec3aa76f50c.tar.gz
llvm-d5d5a3dcbaa4e7f394ba045e2d7d0ec3aa76f50c.tar.bz2
llvm-d5d5a3dcbaa4e7f394ba045e2d7d0ec3aa76f50c.tar.xz
Change tblgen to emit FOOISD opcode names as two
bytes instead of one byte. This is important because we're running up to too many opcodes to fit in a byte and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE making the numbering sparse. This just bites the bullet and bloats out the table. In practice, this increases the size of the x86 isel table from 74.5K to 76K. I think we'll cope :) This fixes rdar://7791648 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcherEmitter.cpp')
-rw-r--r--utils/TableGen/DAGISelMatcherEmitter.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/utils/TableGen/DAGISelMatcherEmitter.cpp b/utils/TableGen/DAGISelMatcherEmitter.cpp
index 704fe94422..22a3430f98 100644
--- a/utils/TableGen/DAGISelMatcherEmitter.cpp
+++ b/utils/TableGen/DAGISelMatcherEmitter.cpp
@@ -255,9 +255,9 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
}
case Matcher::CheckOpcode:
- OS << "OPC_CheckOpcode, "
- << cast<CheckOpcodeMatcher>(N)->getOpcode().getEnumName() << ",\n";
- return 2;
+ OS << "OPC_CheckOpcode, TARGET_OPCODE("
+ << cast<CheckOpcodeMatcher>(N)->getOpcode().getEnumName() << "),\n";
+ return 3;
case Matcher::SwitchOpcode:
case Matcher::SwitchType: {
@@ -315,16 +315,17 @@ EmitMatcher(const Matcher *N, unsigned Indent, unsigned CurrentIdx,
CurrentIdx += EmitVBRValue(ChildSize, OS);
OS << ' ';
- if (const SwitchOpcodeMatcher *SOM = dyn_cast<SwitchOpcodeMatcher>(N))
- OS << SOM->getCaseOpcode(i).getEnumName();
- else
- OS << getEnumName(cast<SwitchTypeMatcher>(N)->getCaseType(i));
- OS << ',';
+ if (const SwitchOpcodeMatcher *SOM = dyn_cast<SwitchOpcodeMatcher>(N)) {
+ OS << "TARGET_OPCODE(" << SOM->getCaseOpcode(i).getEnumName() << "),";
+ CurrentIdx += 2;
+ } else {
+ OS << getEnumName(cast<SwitchTypeMatcher>(N)->getCaseType(i)) << ',';
+ ++CurrentIdx;
+ }
if (!OmitComments)
- OS << "// ->" << CurrentIdx+ChildSize+1;
+ OS << "// ->" << CurrentIdx+ChildSize;
OS << '\n';
- ++CurrentIdx;
OS << TmpBuf.str();
CurrentIdx += ChildSize;
}