summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcher.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-24 05:33:42 +0000
committerChris Lattner <sabre@nondot.org>2010-02-24 05:33:42 +0000
commit02f73585f7d018ea3ddcda88c8273ee4e5ea4de3 (patch)
tree5d2407fb803c6ee01369d5a82ad80516c792ff9b /utils/TableGen/DAGISelMatcher.h
parent91ff7f75f55a626eb41761f3ded9f3d13002980c (diff)
downloadllvm-02f73585f7d018ea3ddcda88c8273ee4e5ea4de3.tar.gz
llvm-02f73585f7d018ea3ddcda88c8273ee4e5ea4de3.tar.bz2
llvm-02f73585f7d018ea3ddcda88c8273ee4e5ea4de3.tar.xz
The new isel was not properly handling patterns that covered
internal nodes with flag results. Record these with a new OPC_MarkFlagResults opcode and use this to update the interior nodes' flag results properly. This fixes CodeGen/X86/i256-add.ll with the new isel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcher.h')
-rw-r--r--utils/TableGen/DAGISelMatcher.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h
index 2379a218fa..469a2807ff 100644
--- a/utils/TableGen/DAGISelMatcher.h
+++ b/utils/TableGen/DAGISelMatcher.h
@@ -71,6 +71,7 @@ public:
EmitCopyToReg, // Emit a copytoreg into a physreg.
EmitNode, // Create a DAG node
EmitNodeXForm, // Run a SDNodeXForm
+ MarkFlagResults, // Indicate which interior nodes have flag results.
CompleteMatch // Finish a match and update the results.
};
const KindTy Kind;
@@ -623,6 +624,29 @@ public:
virtual void print(raw_ostream &OS, unsigned indent = 0) const;
};
+/// MarkFlagResultsMatcherNode - This node indicates which non-root nodes in the
+/// pattern produce flags. This allows CompleteMatchMatcherNode to update them
+/// with the output flag of the resultant code.
+class MarkFlagResultsMatcherNode : public MatcherNode {
+ SmallVector<unsigned, 3> FlagResultNodes;
+public:
+ MarkFlagResultsMatcherNode(const unsigned *nodes, unsigned NumNodes)
+ : MatcherNode(MarkFlagResults), FlagResultNodes(nodes, nodes+NumNodes) {}
+
+ unsigned getNumNodes() const { return FlagResultNodes.size(); }
+
+ unsigned getNode(unsigned i) const {
+ assert(i < FlagResultNodes.size());
+ return FlagResultNodes[i];
+ }
+
+ static inline bool classof(const MatcherNode *N) {
+ return N->getKind() == MarkFlagResults;
+ }
+
+ virtual void print(raw_ostream &OS, unsigned indent = 0) const;
+};
+
/// CompleteMatchMatcherNode - Complete a match by replacing the results of the
/// pattern with the newly generated nodes. This also prints a comment
/// indicating the source and dest patterns.