forked from OSchip/llvm-project
e179532284
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 |
||
---|---|---|
.. | ||
Bindings | ||
Dialects | ||
Rationale | ||
Tools | ||
Tutorials | ||
includes/img | ||
AttributesAndTypes.md | ||
BufferDeallocationInternals.md | ||
Bufferization.md | ||
CAPI.md | ||
CMakeLists.txt | ||
Canonicalization.md | ||
DataLayout.md | ||
DebugActions.md | ||
DeclarativeRewrites.md | ||
DefiningDialects.md | ||
Diagnostics.md | ||
DialectConversion.md | ||
Interfaces.md | ||
LangRef.md | ||
OpDefinitions.md | ||
PDLL.md | ||
PassManagement.md | ||
Passes.md | ||
PatternRewriter.md | ||
Quantization.md | ||
README.txt | ||
SPIRVToLLVMDialectConversion.md | ||
ShapeInference.md | ||
SymbolsAndSymbolTables.md | ||
TargetLLVMIR.md | ||
Traits.md | ||
doxygen-mainpage.dox | ||
doxygen.cfg.in |
README.txt
MLIR documentation ================== Please note mlir.llvm.org is where MLIR's rendered documentation is displayed. The viewing experience on GitHub or elsewhere may not match those of the website. For any changes please verify instead that they work on the main website first. See https://github.com/llvm/mlir-www for the website generation information.