From 82df5096eabeef337d691f97974ba32631106088 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 7 Oct 2010 00:01:00 +0000 Subject: [PATCH] add a common SDPatternOperator base class to SDNode and PatFrag for 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 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/llvm/Target/TargetSelectionDAG.td b/include/llvm/Target/TargetSelectionDAG.td index 9b996b255b2..61769560998 100644 --- a/include/llvm/Target/TargetSelectionDAG.td +++ b/include/llvm/Target/TargetSelectionDAG.td @@ -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 props = [], string sdclass = "SDNode"> { + list props = [], string sdclass = "SDNode"> + : SDPatternOperator { string Opcode = opcode; string SDClass = sdclass; list Properties = props; @@ -474,7 +479,7 @@ def NOOP_SDNodeXForm : SDNodeXForm; /// DAG, frame a single node to multiply nested other fragments. /// class PatFrag { + SDNodeXForm xform = NOOP_SDNodeXForm> : SDPatternOperator { dag Operands = ops; dag Fragment = frag; code Predicate = pred;