@@ -19,11 +19,24 @@ include "mlir/Interfaces/DataLayoutInterfaces.td"
1919// LLVM_TargetAttr
2020//===----------------------------------------------------------------------===//
2121
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 ";
2525 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.
2740 }];
2841 let parameters = (ins "StringAttr":$triple,
2942 OptionalParameter<"StringAttr">:$chip,
@@ -50,9 +63,14 @@ def LLVM_TargetAttr : LLVM_Attr<"Target", "target", [LLVM_TargetAttrInterface]>
5063
5164def LLVM_DataLayoutAttr
5265 : LLVM_Attr<"DataLayout", "data_layout", [DataLayoutSpecInterface]> {
53- let summary = "TODO ";
66+ let summary = "LLVM data layout string, exposed through DLTI ";
5467 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.
5674 }];
5775 let parameters = (ins "StringAttr":$data_layout_str,
5876 OptionalParameter<"DataLayoutSpecInterface", "{}">:$data_layout_spec);
0 commit comments