@@ -19,11 +19,24 @@ include "mlir/Interfaces/DataLayoutInterfaces.td"
19
19
// LLVM_TargetAttr
20
20
//===----------------------------------------------------------------------===//
21
21
22
- def LLVM_TargetAttr : LLVM_Attr<"Target", "target", [LLVM_TargetAttrInterface]> {
23
- let mnemonic = "target";
24
- let summary = "TODO ";
22
+ def LLVM_TargetAttr : LLVM_Attr<"Target", "target",
23
+ [LLVM_TargetAttrInterface]> {
24
+ let summary = "LLVM target info: triple, chip, features ";
25
25
let description = [{
26
- TODO
26
+ An attribute to hold LLVM target information, specifying LLVM's target
27
+ `triple` string, the target `chip` string (i.e. the `cpu` string), and
28
+ target `features` string as an attribute. The latter two are optional.
29
+
30
+ Has facilities to obtain the corresponding `llvm::TargetMachine` and
31
+ `llvm::DataLayout`, given the relevant LLVM backend is loaded.
32
+
33
+ ---
34
+
35
+ Responds to DLTI-queries on the keys:
36
+ * A query for `"triple"` returns the `StringAttr` for the `triple`.
37
+ * A query for `"chip"` returns the `StringAttr` for the `chip`/`cpu`, if provided.
38
+ * A query for `"features"` returns the `TargetFeaturesAttr`, if provided.
39
+ * Individual features can be queried for on this attribute.
27
40
}];
28
41
let parameters = (ins "StringAttr":$triple,
29
42
OptionalParameter<"StringAttr">:$chip,
@@ -50,9 +63,14 @@ def LLVM_TargetAttr : LLVM_Attr<"Target", "target", [LLVM_TargetAttrInterface]>
50
63
51
64
def LLVM_DataLayoutAttr
52
65
: LLVM_Attr<"DataLayout", "data_layout", [DataLayoutSpecInterface]> {
53
- let summary = "TODO ";
66
+ let summary = "LLVM data layout string, exposed through DLTI ";
54
67
let description = [{
55
- TODO
68
+ An attribute to hold a LLVM data layout string.
69
+
70
+ The LLVM data layout string is parsed and mapped to the corresponding MLIR
71
+ data layout specification. The `#llvm.data_layout` attribute then serves as
72
+ a proxy, forwarding all DLTI queries to the underlying MLIR data layout
73
+ specification.
56
74
}];
57
75
let parameters = (ins "StringAttr":$data_layout_str,
58
76
OptionalParameter<"DataLayoutSpecInterface", "{}">:$data_layout_spec);
0 commit comments