diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2005-12-08 04:28:48 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2005-12-08 04:28:48 +0000 |
| commit | 790af6d18fb6cafffb3b8803b376ea892c720df3 (patch) | |
| tree | d83584e05900e3dc22887116e2245205436178a0 /llvm/lib/Target | |
| parent | f0396486148ec53b59be419498971a09416bb954 (diff) | |
| download | bcm5719-llvm-790af6d18fb6cafffb3b8803b376ea892c720df3.tar.gz bcm5719-llvm-790af6d18fb6cafffb3b8803b376ea892c720df3.zip | |
Added support for ComplexPattern.
llvm-svn: 24638
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/TargetSelectionDAG.td | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetSelectionDAG.td b/llvm/lib/Target/TargetSelectionDAG.td index 5be65e2933b..996777f1ed8 100644 --- a/llvm/lib/Target/TargetSelectionDAG.td +++ b/llvm/lib/Target/TargetSelectionDAG.td @@ -131,6 +131,10 @@ def SDTWritePort : SDTypeProfile<0, 2, [ // writeport SDTCisInt<0>, SDTCisInt<1> ]>; +def SDTLoad : SDTypeProfile<1, 1, [ // load + SDTCisInt<1> +]>; + //===----------------------------------------------------------------------===// // Selection DAG Node Properties. // @@ -220,6 +224,8 @@ def ret : SDNode<"ISD::RET" , SDTRet, [SDNPHasChain]>; def writeport : SDNode<"ISD::WRITEPORT" , SDTWritePort, [SDNPHasChain]>; +def load : SDNode<"ISD::LOAD" , SDTLoad, [SDNPHasChain]>; + //===----------------------------------------------------------------------===// // Selection DAG Condition Codes @@ -349,3 +355,18 @@ class Pattern<dag patternToMatch, list<dag> resultInstrs> { // 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; +} |

