summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/DAGISelMatcherGen.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-17 01:34:15 +0000
committerChris Lattner <sabre@nondot.org>2010-02-17 01:34:15 +0000
commit022e511f4ad0f3d5b0e55f81559bf2f384cb96a3 (patch)
tree4f4144036dd95c7179063a8da65b39f228a1f4ac /llvm/utils/TableGen/DAGISelMatcherGen.cpp
parentac27c2e3f3cd2527bf50fd114ebc3387d36f678a (diff)
downloadbcm5719-llvm-022e511f4ad0f3d5b0e55f81559bf2f384cb96a3.tar.gz
bcm5719-llvm-022e511f4ad0f3d5b0e55f81559bf2f384cb96a3.zip
record input chains.
llvm-svn: 96437
Diffstat (limited to 'llvm/utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r--llvm/utils/TableGen/DAGISelMatcherGen.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/DAGISelMatcherGen.cpp b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
index 345b964c2d1..5936e750654 100644
--- a/llvm/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherGen.cpp
@@ -194,6 +194,15 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N,
// the child numbers of the node are all offset by one.
unsigned OpNo = 0;
if (N->NodeHasProperty(SDNPHasChain, CGP)) {
+ // Record the input chain, which is always input #0 of the SDNode.
+ AddMatcherNode(new MoveChildMatcherNode(0));
+ ++NextRecordedOperandNo;
+ AddMatcherNode(new RecordMatcherNode("'" + N->getOperator()->getName() +
+ "' input chain"));
+ AddMatcherNode(new MoveParentMatcherNode());
+
+ // Don't look at the input chain when matching the tree pattern to the
+ // SDNode.
OpNo = 1;
// If this node is not the root and the subtree underneath it produces a
OpenPOWER on IntegriCloud