add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex
pattern. This fixes 4 regtest failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96814 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/DAGISelMatcher.h b/utils/TableGen/DAGISelMatcher.h
index c162a0c..2379a21 100644
--- a/utils/TableGen/DAGISelMatcher.h
+++ b/utils/TableGen/DAGISelMatcher.h
@@ -51,6 +51,7 @@
CheckPatternPredicate,
CheckPredicate, // Fail if node predicate fails.
CheckOpcode, // Fail if not opcode.
+ CheckMultiOpcode, // Fail if not in opcode list.
CheckType, // Fail if not correct type.
CheckInteger, // Fail if wrong val.
CheckCondCode, // Fail if not condcode.
@@ -262,6 +263,26 @@
virtual void print(raw_ostream &OS, unsigned indent = 0) const;
};
+/// CheckMultiOpcodeMatcherNode - This checks to see if the current node has one
+/// of the specified opcode, if not it fails to match.
+class CheckMultiOpcodeMatcherNode : public MatcherNode {
+ SmallVector<StringRef, 4> OpcodeNames;
+public:
+ CheckMultiOpcodeMatcherNode(const StringRef *opcodes, unsigned numops)
+ : MatcherNode(CheckMultiOpcode), OpcodeNames(opcodes, opcodes+numops) {}
+
+ unsigned getNumOpcodeNames() const { return OpcodeNames.size(); }
+ StringRef getOpcodeName(unsigned i) const { return OpcodeNames[i]; }
+
+ static inline bool classof(const MatcherNode *N) {
+ return N->getKind() == CheckMultiOpcode;
+ }
+
+ virtual void print(raw_ostream &OS, unsigned indent = 0) const;
+};
+
+
+
/// CheckTypeMatcherNode - This checks to see if the current node has the
/// specified type, if not it fails to match.
class CheckTypeMatcherNode : public MatcherNode {