MLIR
19.0.0git
|
A data layout specification is a list of entries that specify (partial) data layout information. More...
#include "mlir/Dialect/DLTI/DLTI.h"
Public Types | |
using | Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits... > |
Utility declarations for the concrete attribute class. More... | |
Public Types inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits > | |
using | Base = StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits... > |
Utility declarations for the concrete attribute class. More... | |
using | ImplType = StorageT |
using | HasTraitFn = bool(*)(TypeID) |
Public Member Functions | |
DataLayoutSpecAttr | combineWith (ArrayRef< DataLayoutSpecInterface > specs) const |
Combines this specification with specs , enclosing specifications listed from outermost to innermost. More... | |
DataLayoutEntryListRef | getEntries () const |
Returns the list of entries. More... | |
StringAttr | getEndiannessIdentifier (MLIRContext *context) const |
Returns the endiannes identifier. More... | |
StringAttr | getAllocaMemorySpaceIdentifier (MLIRContext *context) const |
Returns the alloca memory space identifier. More... | |
StringAttr | getProgramMemorySpaceIdentifier (MLIRContext *context) const |
Returns the program memory space identifier. More... | |
StringAttr | getGlobalMemorySpaceIdentifier (MLIRContext *context) const |
Returns the global memory space identifier. More... | |
StringAttr | getStackAlignmentIdentifier (MLIRContext *context) const |
Returns the stack alignment identifier. More... | |
void | print (AsmPrinter &os) const |
Prints this attribute. More... | |
Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits > | |
ImplType * | getImpl () const |
Utility for easy access to the storage instance. More... | |
Static Public Member Functions | |
static DataLayoutSpecAttr | get (MLIRContext *ctx, ArrayRef< DataLayoutEntryInterface > entries) |
Returns the specification containing the given list of keys. More... | |
static DataLayoutSpecAttr | getChecked (function_ref< InFlightDiagnostic()> emitError, MLIRContext *context, ArrayRef< DataLayoutEntryInterface > entries) |
Returns the specification containing the given list of keys. More... | |
static LogicalResult | verify (function_ref< InFlightDiagnostic()> emitError, ArrayRef< DataLayoutEntryInterface > entries) |
Checks that the given list of entries does not contain duplicate keys. More... | |
static DataLayoutSpecAttr | parse (AsmParser &parser) |
Parses an instance of this attribute. More... | |
Static Public Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits > | |
static TypeID | getTypeID () |
Return a unique identifier for the concrete type. More... | |
template<typename T > | |
static bool | classof (T val) |
Provide an implementation of 'classof' that compares the type id of the provided value with that of the concrete type. More... | |
static detail::InterfaceMap | getInterfaceMap () |
Returns an interface map for the interfaces registered to this storage user. More... | |
static HasTraitFn | getHasTraitFn () |
Returns the function that returns true if the given Trait ID matches the IDs of any of the traits defined by the storage user. More... | |
static auto | getWalkImmediateSubElementsFn () |
Returns a function that walks immediate sub elements of a given instance of the storage user. More... | |
static auto | getReplaceImmediateSubElementsFn () |
Returns a function that replaces immediate sub elements of a given instance of the storage user. More... | |
template<typename... IfaceModels> | |
static void | attachInterface (MLIRContext &context) |
Attach the given models as implementations of the corresponding interfaces for the concrete storage user class. More... | |
template<typename... Args> | |
static ConcreteT | get (MLIRContext *ctx, Args &&...args) |
Get or create a new ConcreteT instance within the ctx. More... | |
template<typename... Args> | |
static ConcreteT | getChecked (const Location &loc, Args &&...args) |
Get or create a new ConcreteT instance within the ctx, defined at the given, potentially unknown, location. More... | |
template<typename... Args> | |
static ConcreteT | getChecked (function_ref< InFlightDiagnostic()> emitErrorFn, MLIRContext *ctx, Args... args) |
Get or create a new ConcreteT instance within the ctx. More... | |
static ConcreteT | getFromOpaquePointer (const void *ptr) |
Get an instance of the concrete type from a void pointer. More... | |
Static Public Attributes | |
constexpr static const StringLiteral | kAttrKeyword = "dl_spec" |
The keyword used for this attribute in custom syntax. More... | |
static constexpr StringLiteral | name = "builtin.data_layout_spec" |
Additional Inherited Members | |
Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits > | |
template<typename... Args> | |
LogicalResult | mutate (Args &&...args) |
Mutate the current storage instance. More... | |
Static Protected Member Functions inherited from mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits > | |
template<typename... Args> | |
static LogicalResult | verify (Args... args) |
Default implementation that just returns success. More... | |
A data layout specification is a list of entries that specify (partial) data layout information.
It is expected to be attached to operations that serve as scopes for data layout requests.
using mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::Base = StorageUserBase<ConcreteT, BaseT, StorageT, UniquerT, Traits...> |
Utility declarations for the concrete attribute class.
Definition at line 101 of file StorageUniquerSupport.h.
DataLayoutSpecAttr DataLayoutSpecAttr::combineWith | ( | ArrayRef< DataLayoutSpecInterface > | specs | ) | const |
Combines this specification with specs
, enclosing specifications listed from outermost to innermost.
This overwrites the older entries with the same key as the newer entries if the entries are compatible. Returns null if the specifications are not compatible.
Definition at line 254 of file DLTI.cpp.
References combineOneSpec(), mlir::failed(), get(), and getContext().
|
static |
Returns the specification containing the given list of keys.
Definition at line 141 of file DLTI.cpp.
References mlir::get().
Referenced by combineWith(), and parse().
StringAttr DataLayoutSpecAttr::getAllocaMemorySpaceIdentifier | ( | MLIRContext * | context | ) | const |
Returns the alloca memory space identifier.
Definition at line 290 of file DLTI.cpp.
References mlir::Builder::getStringAttr().
|
static |
Returns the specification containing the given list of keys.
If the list contains duplicate keys or is otherwise invalid, reports errors using the given callback and returns null.
Definition at line 147 of file DLTI.cpp.
References mlir::emitError().
Referenced by parse().
StringAttr DataLayoutSpecAttr::getEndiannessIdentifier | ( | MLIRContext * | context | ) | const |
Returns the endiannes identifier.
Definition at line 285 of file DLTI.cpp.
References mlir::Builder::getStringAttr().
DataLayoutEntryListRef DataLayoutSpecAttr::getEntries | ( | ) | const |
Returns the list of entries.
Definition at line 280 of file DLTI.cpp.
References mlir::detail::StorageUserBase< ConcreteT, BaseT, StorageT, UniquerT, Traits >::getImpl().
Referenced by print().
StringAttr DataLayoutSpecAttr::getGlobalMemorySpaceIdentifier | ( | MLIRContext * | context | ) | const |
Returns the global memory space identifier.
Definition at line 302 of file DLTI.cpp.
References mlir::Builder::getStringAttr().
StringAttr DataLayoutSpecAttr::getProgramMemorySpaceIdentifier | ( | MLIRContext * | context | ) | const |
Returns the program memory space identifier.
Definition at line 295 of file DLTI.cpp.
References mlir::Builder::getStringAttr().
StringAttr DataLayoutSpecAttr::getStackAlignmentIdentifier | ( | MLIRContext * | context | ) | const |
Returns the stack alignment identifier.
Definition at line 307 of file DLTI.cpp.
References mlir::Builder::getStringAttr().
|
static |
Parses an instance of this attribute.
Parses an attribute with syntax attr ::= #target.
dl_spec
<
attr-list? >
attr-list ::= attr | attr ,
attr-list
Definition at line 316 of file DLTI.cpp.
References mlir::AsmParser::emitError(), mlir::failed(), get(), getChecked(), mlir::AsmParser::getContext(), mlir::AsmParser::getNameLoc(), mlir::AsmParser::parseCommaSeparatedList(), mlir::AsmParser::parseGreater(), mlir::AsmParser::parseLess(), mlir::AsmParser::parseOptionalGreater(), and mlir::succeeded().
void DataLayoutSpecAttr::print | ( | AsmPrinter & | os | ) | const |
Prints this attribute.
Definition at line 334 of file DLTI.cpp.
References getEntries(), and kAttrKeyword.
|
static |
Checks that the given list of entries does not contain duplicate keys.
Definition at line 154 of file DLTI.cpp.
References mlir::emitError(), and mlir::success().
|
staticconstexpr |
|
staticconstexpr |