diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-19 05:07:09 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-19 05:07:09 +0000 |
commit | e8cabf3c2eb835f9189a39c810654d9bd302f7ee (patch) | |
tree | f941dd1fcd848b714c9d589a6fdac67c96c75d84 /utils | |
parent | 5a9b8fb95c9a4c6fd5e06c1e89fa9263d39cd252 (diff) | |
download | llvm-e8cabf3c2eb835f9189a39c810654d9bd302f7ee.tar.gz llvm-e8cabf3c2eb835f9189a39c810654d9bd302f7ee.tar.bz2 llvm-e8cabf3c2eb835f9189a39c810654d9bd302f7ee.tar.xz |
add a new SDNPVariadic SDNP node flag, and use it in
dag isel gen instead of instruction properties. This
allows the oh-so-useful behavior of matching a variadic
non-root node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/CodeGenDAGPatterns.cpp | 2 | ||||
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 2 | ||||
-rw-r--r-- | utils/TableGen/CodeGenTarget.h | 3 | ||||
-rw-r--r-- | utils/TableGen/DAGISelMatcherGen.cpp | 3 |
4 files changed, 8 insertions, 2 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp index 98f86f8246..3e1b5dabba 100644 --- a/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/utils/TableGen/CodeGenDAGPatterns.cpp @@ -671,6 +671,8 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) { Properties |= 1 << SDNPSideEffect; } else if (PropList[i]->getName() == "SDNPMemOperand") { Properties |= 1 << SDNPMemOperand; + } else if (PropList[i]->getName() == "SDNPVariadic") { + Properties |= 1 << SDNPVariadic; } else { errs() << "Unknown SD Node property '" << PropList[i]->getName() << "' on node '" << R->getName() << "'!\n"; diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index a0c2c21287..79bc30d8c9 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -395,6 +395,8 @@ ComplexPattern::ComplexPattern(Record *R) { Properties |= 1 << SDNPSideEffect; } else if (PropList[i]->getName() == "SDNPMemOperand") { Properties |= 1 << SDNPMemOperand; + } else if (PropList[i]->getName() == "SDNPVariadic") { + Properties |= 1 << SDNPVariadic; } else { errs() << "Unsupported SD Node property '" << PropList[i]->getName() << "' on ComplexPattern '" << R->getName() << "'!\n"; diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index f5952bccf0..29264189b7 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -43,7 +43,8 @@ enum SDNP { SDNPMayLoad, SDNPMayStore, SDNPSideEffect, - SDNPMemOperand + SDNPMemOperand, + SDNPVariadic }; /// getValueType - Return the MVT::SimpleValueType that the specified TableGen diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp index 0d7d9ae73a..d093837829 100644 --- a/utils/TableGen/DAGISelMatcherGen.cpp +++ b/utils/TableGen/DAGISelMatcherGen.cpp @@ -738,7 +738,8 @@ EmitResultInstructionAsOperand(const TreePatternNode *N, // have an SDNP that indicates variadicism. The TargetInstrInfo isVariadic // property should be inferred from this when an instruction has a pattern. int NumFixedArityOperands = -1; - if (isRoot && II.isVariadic) + if (N->NodeHasProperty(SDNPVariadic, CGP) || + (isRoot && II.isVariadic)) NumFixedArityOperands = Pattern.getSrcPattern()->getNumChildren(); // If this is the root node and any of the nodes matched nodes in the input |