summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2008-01-31 07:27:46 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2008-01-31 07:27:46 +0000
commit0592cf7e7406e41ce3658bf829e3ccdc31ed162c (patch)
tree8e4463ebfa8bd0c09acaa483475e582103ec0886 /llvm/lib
parent58ffa8c57a3b8a2b60a1cf0de0165b85f2116a05 (diff)
downloadbcm5719-llvm-0592cf7e7406e41ce3658bf829e3ccdc31ed162c.tar.gz
bcm5719-llvm-0592cf7e7406e41ce3658bf829e3ccdc31ed162c.zip
Allow ComplexExpressions in InstrInfo.td files to be slightly more... complex! ComplexExpressions can now have attributes which affect how TableGen interprets
the pattern when generating matchin code. The first (and currently, only) attribute causes the immediate parent node of the ComplexPattern operand to be passed into the matching code rather than the node at the root of the entire DAG containing the pattern. llvm-svn: 46606
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/TargetSelectionDAG.td10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetSelectionDAG.td b/llvm/lib/Target/TargetSelectionDAG.td
index a31ef2d3681..cdc50fa4b28 100644
--- a/llvm/lib/Target/TargetSelectionDAG.td
+++ b/llvm/lib/Target/TargetSelectionDAG.td
@@ -767,6 +767,12 @@ class Pat<dag pattern, dag result> : Pattern<pattern, [result]>;
//===----------------------------------------------------------------------===//
// Complex pattern definitions.
//
+
+class CPAttribute;
+// Pass the parent Operand as root to CP function rather
+// than the root of the sub-DAG
+def CPAttrParentAsRoot : CPAttribute;
+
// 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;
@@ -774,12 +780,14 @@ class Pat<dag pattern, dag result> : Pattern<pattern, [result]>;
// e.g. X86 addressing mode - def addr : ComplexPattern<4, "SelectAddr", [add]>;
//
class ComplexPattern<ValueType ty, int numops, string fn,
- list<SDNode> roots = [], list<SDNodeProperty> props = []> {
+ list<SDNode> roots = [], list<SDNodeProperty> props = [],
+ list<CPAttribute> attrs = []> {
ValueType Ty = ty;
int NumOperands = numops;
string SelectFunc = fn;
list<SDNode> RootNodes = roots;
list<SDNodeProperty> Properties = props;
+ list<CPAttribute> Attributes = attrs;
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud