add a common SDPatternOperator base class to SDNode and PatFrag for
authorChris Lattner <sabre@nondot.org>
Thu, 7 Oct 2010 00:01:00 +0000 (00:01 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Oct 2010 00:01:00 +0000 (00:01 +0000)
stuff that wants to take one or the other.  These can both be used
as the operation of a dag in a pattern match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115877 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetSelectionDAG.td

index 9b996b255b21300fe1a7dc23f931b0cb9c417968..61769560998d9fb4cc9b68ce0fe889792b090779 100644 (file)
@@ -227,11 +227,16 @@ def SDNPVariadic    : SDNodeProperty;   // Node has variable arguments.
 def SDNPWantRoot    : SDNodeProperty;   // ComplexPattern gets the root of match
 def SDNPWantParent  : SDNodeProperty;   // ComplexPattern gets the parent
 
+//===----------------------------------------------------------------------===//
+// Selection DAG Pattern Operations
+class SDPatternOperator;
+
 //===----------------------------------------------------------------------===//
 // Selection DAG Node definitions.
 //
 class SDNode<string opcode, SDTypeProfile typeprof,
-             list<SDNodeProperty> props = [], string sdclass = "SDNode"> {
+             list<SDNodeProperty> props = [], string sdclass = "SDNode"> 
+             : SDPatternOperator {
   string Opcode  = opcode;
   string SDClass = sdclass;
   list<SDNodeProperty> Properties = props;
@@ -474,7 +479,7 @@ def NOOP_SDNodeXForm : SDNodeXForm<imm, [{}]>;
 /// DAG, frame a single node to multiply nested other fragments.
 ///
 class PatFrag<dag ops, dag frag, code pred = [{}],
-              SDNodeXForm xform = NOOP_SDNodeXForm> {
+              SDNodeXForm xform = NOOP_SDNodeXForm> : SDPatternOperator {
   dag Operands = ops;
   dag Fragment = frag;
   code Predicate = pred;