llvm-project/mlir/test/mlir-tblgen
Jeff Niu e179532284 [mlir] Remove types from attributes
This patch removes the `type` field from `Attribute` along with the
`Attribute::getType` accessor.

Going forward, this means that attributes in MLIR will no longer have
types as a first-class concept. This patch lays the groundwork to
incrementally remove or refactor code that relies on generic attributes
being typed. The immediate impact will be on attributes that rely on
`Attribute` containing a type, such as `IntegerAttr`,
`DenseElementsAttr`, and `ml_program::ExternAttr`, which will now need
to define a type parameter on their storage classes. This will save
memory as all other attribute kinds will no longer contain a type.

Moreover, it will not be possible to generically query the type of an
attribute directly. This patch provides an attribute interface
`TypedAttr` that implements only one method, `getType`, which can be
used to generically query the types of attributes that implement the
interface. This interface can be used to retain the concept of a "typed
attribute". The ODS-generated accessor for a `type` parameter
automatically implements this method.

Next steps will be to refactor the assembly formats of certain operations
that rely on `parseAttribute(type)` and `printAttributeWithoutType` to
remove special handling of type elision until `type` can be removed from
the dialect parsing hook entirely; and incrementally remove uses of
`TypedAttr`.

Reviewed By: lattner, rriddle, jpienaar

Differential Revision: https://reviews.llvm.org/D130092
2022-07-31 20:01:31 -04:00
..
attr-or-type-builder-invalid.td [mlir][tblgen] Improving error messages 2022-06-30 18:25:53 -07:00
attr-or-type-format-invalid.td [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td 2022-03-15 00:18:03 -07:00
attr-or-type-format-roundtrip.mlir [mlir:Parser] Don't use strings for the "ugly" form of Attribute/Type syntax 2022-07-05 16:20:30 -07:00
attr-or-type-format.mlir [mlir:Parser] Don't use strings for the "ugly" form of Attribute/Type syntax 2022-07-05 16:20:30 -07:00
attr-or-type-format.td [mlir] Remove types from attributes 2022-07-31 20:01:31 -04:00
attrdefs.td [mlir] Remove types from attributes 2022-07-31 20:01:31 -04:00
constant-str-attr-invalid.mlir [MLIR][ODS] default-valued strings should be in quotes 2021-10-15 03:00:41 +00:00
constraint-unique.td [mlir][ods] ODS-level Attribute Optimizations 2022-04-11 18:34:07 +00:00
default-type-attr-print-parser.td [mlir:LSP] Add support for code completing attributes and types 2022-07-08 16:24:55 -07:00
deprecation.td [mlir][ods] Add Deprecate helper 2022-03-22 11:08:36 -07:00
dialect.td [mlir][ODS]: Add per-op cppNamespace. 2021-05-11 10:48:05 -07:00
directive-common.td [mlir][OpenMP] Generating enums in accordance with the guidelines 2022-03-09 20:10:45 +05:30
expect-symbol.td [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td 2022-03-15 00:18:03 -07:00
gen-dialect-doc.td [mlir][doc] Avoid duplication with constraints and defs 2022-06-16 19:42:56 -07:00
interfaces-as-constraints.td [mlir] Explicitly mark dialect prefixing 2022-07-21 12:58:19 -07:00
interfaces.mlir
llvm-intrinsics.td Support alias.scope and noalias metadata lowering on intrinsics. 2021-09-01 16:54:20 +00:00
op-attribute.td [mlir] Introduce DefaultValuedOptionalAttr 2022-07-28 14:43:13 -07:00
op-decl-and-defs.td [FileCheck] Catch missspelled directives. 2022-05-26 11:37:19 +01:00
op-derived-attribute.mlir [mlir][NFC] Update textual references of `func` to `func.func` in tool/runner tests 2022-04-20 22:17:30 -07:00
op-error.td [mlir] Support verification order (1/3) 2022-02-02 18:25:44 +00:00
op-format-spec.td [mlir][ods] Fix verification of attribute + colon type ambiguity 2022-05-16 21:15:27 +00:00
op-format-verify.td [mlir][ods] Fix verification of attribute + colon type ambiguity 2022-05-16 21:15:27 +00:00
op-format.mlir [mlir][ods] Fix verification of attribute + colon type ambiguity 2022-05-16 21:15:27 +00:00
op-interface.td [mlir] Support verification order (2/3) 2022-02-25 19:04:56 +00:00
op-operand.td [mlir] Explicitly mark dialect prefixing 2022-07-21 12:58:19 -07:00
op-python-bindings.td [mlir][tablegen] Generate default attr values in Python bindings 2022-06-15 16:40:27 +02:00
op-result.td [mlir] Remove types from attributes 2022-07-31 20:01:31 -04:00
op-side-effects.td [mlir] Explicitly mark dialect prefixing 2022-07-21 12:58:19 -07:00
pattern.mlir [mlir][NFC] Update remaining textual references of un-namespaced `func` operations 2022-04-20 22:17:31 -07:00
predicate.td Remove OpTrait, AttrTrait and TypeTrait 2022-01-31 11:04:00 -08:00
return-types.mlir [mlir] Add refineReturnTypes to InferTypeOpInterface 2022-07-18 22:18:52 -07:00
rewriter-errors.td [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td 2022-03-15 00:18:03 -07:00
rewriter-indexing.td [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td 2022-03-15 00:18:03 -07:00
rewriter-static-matcher.td [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td 2022-03-15 00:18:03 -07:00
testdialect-attrdefs.mlir [mlir][ods] Allow specifying return types of builders 2022-07-15 18:00:35 -07:00
testdialect-typedefs.mlir [mlir][NFC] Update textual references of `func` to `func.func` in tool/runner tests 2022-04-20 22:17:30 -07:00
trait.mlir [mlir][NFC] Update textual references of `func` to `func.func` in tool/runner tests 2022-04-20 22:17:30 -07:00
typedefs.td [mlir:LSP] Add support for code completing attributes and types 2022-07-08 16:24:55 -07:00
types.mlir [mlir][NFC] Update textual references of `func` to `func.func` in tool/runner tests 2022-04-20 22:17:30 -07:00