summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelMatcher.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-16 19:15:55 +0000
committerChris Lattner <sabre@nondot.org>2010-02-16 19:15:55 +0000
commit21390d79843050ae8b3226860cadc16ff51d0dcf (patch)
tree1cd90d41aecaf92f7942786cbf96905a76084489 /utils/TableGen/DAGISelMatcher.h
parent29c6270328cf1dad1dee063990015a4c9b583e1f (diff)
downloadllvm-21390d79843050ae8b3226860cadc16ff51d0dcf.tar.gz
llvm-21390d79843050ae8b3226860cadc16ff51d0dcf.tar.bz2
llvm-21390d79843050ae8b3226860cadc16ff51d0dcf.tar.xz
convert the new matcher to check intermediate nodes for a single
use and only call IsProfitableToFold/IsLegalToFold on the load being folded, like the old dagiselemitter does. This substantially simplifies the code and improves opportunities for sharing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/DAGISelMatcher.h')
-rw-r--r--utils/TableGen/DAGISelMatcher.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h
index b40fbf9cd0..68737e2796 100644
--- a/utils/TableGen/DAGISelMatcher.h
+++ b/utils/TableGen/DAGISelMatcher.h
@@ -50,8 +50,7 @@ public:
CheckComplexPat,
CheckAndImm,
CheckOrImm,
- CheckProfitableToFold,
- CheckLegalToFold
+ CheckFoldableChainNode
};
const KindTy Kind;
@@ -359,33 +358,20 @@ public:
virtual void print(raw_ostream &OS, unsigned indent = 0) const;
};
-/// CheckProfitableToFoldMatcherNode - This checks to see if the current node is
-/// worthwhile to try to fold into a large pattern.
-class CheckProfitableToFoldMatcherNode : public MatcherNodeWithChild {
+/// CheckFoldableChainNodeMatcherNode - This checks to see if the current node
+/// (which defines a chain operand) is safe to fold into a larger pattern.
+class CheckFoldableChainNodeMatcherNode : public MatcherNodeWithChild {
public:
- CheckProfitableToFoldMatcherNode()
- : MatcherNodeWithChild(CheckProfitableToFold) {}
+ CheckFoldableChainNodeMatcherNode()
+ : MatcherNodeWithChild(CheckFoldableChainNode) {}
static inline bool classof(const MatcherNode *N) {
- return N->getKind() == CheckProfitableToFold;
+ return N->getKind() == CheckFoldableChainNode;
}
virtual void print(raw_ostream &OS, unsigned indent = 0) const;
};
-/// CheckLegalToFoldMatcherNode - This checks to see if the current node is
-/// legal to try to fold into a large pattern.
-class CheckLegalToFoldMatcherNode : public MatcherNodeWithChild {
-public:
- CheckLegalToFoldMatcherNode()
- : MatcherNodeWithChild(CheckLegalToFold) {}
-
- static inline bool classof(const MatcherNode *N) {
- return N->getKind() == CheckLegalToFold;
- }
-
- virtual void print(raw_ostream &OS, unsigned indent = 0) const;
-};
} // end namespace llvm
#endif