[llvm-commits] CVS: llvm/lib/Target/TargetSelectionDAG.td

Evan Cheng evan.cheng at apple.com
Wed Dec 7 20:29:00 PST 2005



Changes in directory llvm/lib/Target:

TargetSelectionDAG.td updated: 1.12 -> 1.13
---
Log message:

Added support for ComplexPattern.


---
Diffs of the changes:  (+21 -0)

 TargetSelectionDAG.td |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+)


Index: llvm/lib/Target/TargetSelectionDAG.td
diff -u llvm/lib/Target/TargetSelectionDAG.td:1.12 llvm/lib/Target/TargetSelectionDAG.td:1.13
--- llvm/lib/Target/TargetSelectionDAG.td:1.12	Sun Dec  4 20:37:26 2005
+++ llvm/lib/Target/TargetSelectionDAG.td	Wed Dec  7 22:28:48 2005
@@ -131,6 +131,10 @@
   SDTCisInt<0>, SDTCisInt<1>
 ]>;
 
+def SDTLoad : SDTypeProfile<1, 1, [ // load
+  SDTCisInt<1>  
+]>;
+
 //===----------------------------------------------------------------------===//
 // Selection DAG Node Properties.
 //
@@ -220,6 +224,8 @@
 
 def writeport  : SDNode<"ISD::WRITEPORT"  , SDTWritePort, [SDNPHasChain]>;
 
+def load       : SDNode<"ISD::LOAD"       , SDTLoad, [SDNPHasChain]>;
+
 //===----------------------------------------------------------------------===//
 // Selection DAG Condition Codes
 
@@ -349,3 +355,18 @@
 // not needing a full list.
 class Pat<dag pattern, dag result> : Pattern<pattern, [result]>;
 
+//===----------------------------------------------------------------------===//
+// Complex pattern definitions.
+//
+// Complex patterns, e.g. X86 addressing mode, requires pattern matching code
+// in C++. NumOperands is the number of operands returned by the select function;
+// SelectFunc is the name of the function used to pattern match the max. pattern;
+// RootNodes are the list of possible root nodes of the sub-dags to match.
+// e.g. X86 addressing mode - def addr : ComplexPattern<4, "SelectAddr", [add]>;
+//
+class ComplexPattern<ValueType ty, int numops, string fn, list<SDNode> roots = []> {
+  ValueType Ty = ty;
+  int NumOperands = numops;
+  string SelectFunc = fn;
+  list<SDNode> RootNodes = roots;
+}






More information about the llvm-commits mailing list