summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcherGen.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-17 06:23:39 +0000
committerChris Lattner <sabre@nondot.org>2010-02-17 06:23:39 +0000
commit9a747f1305e76025df2323a03b805a284f2cde77 (patch)
treec8db00f3284a94e5d8896e13a69a240c6f167b32 /utils/TableGen/DAGISelMatcherGen.cpp
parent8dc4f2bb609989c5c73990435d1b6d1aeb13297a (diff)
downloadllvm-9a747f1305e76025df2323a03b805a284f2cde77.tar.gz
llvm-9a747f1305e76025df2323a03b805a284f2cde77.tar.bz2
llvm-9a747f1305e76025df2323a03b805a284f2cde77.tar.xz
Emulate the current isel's "IsChainCompatible" logic for now.
I'd like to eventually rip it out, but for now producing the same selections as the old matcher is more important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96458 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcherGen.cpp')
-rw-r--r--utils/TableGen/DAGISelMatcherGen.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/utils/TableGen/DAGISelMatcherGen.cpp b/utils/TableGen/DAGISelMatcherGen.cpp
index e2ffb8e717..8efcb4f982 100644
--- a/utils/TableGen/DAGISelMatcherGen.cpp
+++ b/utils/TableGen/DAGISelMatcherGen.cpp
@@ -165,6 +165,16 @@ void MatcherGen::EmitLeafMatchCode(const TreePatternNode *N) {
assert(NextRecordedOperandNo > 1 &&
"Should have recorded input/result chains at least!");
InputChains.push_back(NextRecordedOperandNo-1);
+
+ // IF we need to check chains, do so, see comment for
+ // "NodeHasProperty(SDNPHasChain" below.
+ if (InputChains.size() > 1) {
+ // FIXME: This is broken, we should eliminate this nonsense completely,
+ // but we want to produce the same selections that the old matcher does
+ // for now.
+ unsigned PrevOp = InputChains[InputChains.size()-2];
+ AddMatcherNode(new CheckChainCompatibleMatcherNode(PrevOp));
+ }
}
return;
}
@@ -229,10 +239,13 @@ void MatcherGen::EmitOperatorMatchCode(const TreePatternNode *N,
// sure that folding the chain won't induce cycles in the DAG. This could
// happen if there were an intermediate node between the indbr and load, for
// example.
-
- // FIXME: Emit "IsChainCompatible(lastchain.getNode(), CurrentNode)".
- // Rename IsChainCompatible -> IsChainUnreachable, add comment about
- // complexity.
+ if (InputChains.size() > 1) {
+ // FIXME: This is broken, we should eliminate this nonsense completely,
+ // but we want to produce the same selections that the old matcher does
+ // for now.
+ unsigned PrevOp = InputChains[InputChains.size()-2];
+ AddMatcherNode(new CheckChainCompatibleMatcherNode(PrevOp));
+ }
// Don't look at the input chain when matching the tree pattern to the
// SDNode.