My Project
|
#include <Dialect.h>
Classes | |
class | VariadicOperationAdder |
class | VariadicOperationAdder< First > |
struct | VariadicSymbolAdder |
struct | VariadicSymbolAdder< First > |
Public Member Functions | |
virtual | ~Dialect () |
MLIRContext * | getContext () const |
StringRef | getNamespace () const |
bool | allowsUnknownOperations () const |
bool | allowsUnknownTypes () const |
virtual Operation * | materializeConstant (OpBuilder &builder, Attribute value, Type type, Location loc) |
virtual Attribute | parseAttribute (DialectAsmParser &parser, Type type) const |
Parse an attribute registered to this dialect. More... | |
virtual void | printAttribute (Attribute, DialectAsmPrinter &) const |
virtual Type | parseType (DialectAsmParser &parser) const |
Parse a type registered to this dialect. More... | |
virtual void | printType (Type, DialectAsmPrinter &) const |
Print a type registered to this dialect. More... | |
virtual LogicalResult | verifyRegionArgAttribute (Operation *, unsigned regionIndex, unsigned argIndex, NamedAttribute) |
virtual LogicalResult | verifyRegionResultAttribute (Operation *, unsigned regionIndex, unsigned resultIndex, NamedAttribute) |
virtual LogicalResult | verifyOperationAttribute (Operation *, NamedAttribute) |
const DialectInterface * | getRegisteredInterface (ClassID *interfaceID) |
template<typename InterfaceT > | |
const InterfaceT * | getRegisteredInterface () |
Static Public Member Functions | |
static bool | isValidNamespace (StringRef str) |
Public Attributes | |
DialectConstantFoldHook | constantFoldHook |
DialectConstantDecodeHook | decodeHook |
DialectExtractElementHook | extractElementHook |
Protected Member Functions | |
Dialect (StringRef name, MLIRContext *context) | |
template<typename... Args> | |
void | addOperations () |
void | addOperation (AbstractOperation opInfo) |
template<typename... Args> | |
void | addTypes () |
This method is used by derived classes to add their types to the set. More... | |
template<typename... Args> | |
void | addAttributes () |
This method is used by derived classes to add their attributes to the set. More... | |
void | allowUnknownOperations (bool allow=true) |
Enable support for unregistered operations. More... | |
void | allowUnknownTypes (bool allow=true) |
Enable support for unregistered types. More... | |
void | addInterface (std::unique_ptr< DialectInterface > interface) |
Register a dialect interface with this dialect instance. More... | |
template<typename T , typename T2 , typename... Tys> | |
void | addInterfaces () |
Register a set of dialect interfaces with this dialect instance. More... | |
template<typename T > | |
void | addInterfaces () |
Dialects are groups of MLIR operations and behavior associated with the entire group. For example, hooks into other systems for constant folding, default named types for asm printing, etc.
Instances of the dialect object are global across all MLIRContext's that may be active in the process.
|
virtual |
|
protected |
The constructor takes a unique namespace for this dialect as well as the context to bind to. Note: The namespace must not contain '.' characters. Note: All operations belonging to this dialect must have names starting with the namespace followed by '.'. Example:
|
inlineprotected |
This method is used by derived classes to add their attributes to the set.
|
protected |
Register a dialect interface with this dialect instance.
Register a set of dialect interfaces with this dialect instance.
|
inlineprotected |
Register a set of dialect interfaces with this dialect instance.
|
inlineprotected |
|
protected |
|
inlineprotected |
This method is used by derived classes to add their operations to the set.
|
inlineprotected |
This method is used by derived classes to add their types to the set.
|
inline |
Returns true if this dialect allows for unregistered operations, i.e. operations prefixed with the dialect namespace but not registered with addOperation.
|
inline |
Return true if this dialect allows for unregistered types, i.e., types prefixed with the dialect namespace but not registered with addType. These are represented with OpaqueType.
|
inlineprotected |
Enable support for unregistered operations.
|
inlineprotected |
Enable support for unregistered types.
|
inline |
|
inline |
|
inline |
Lookup an interface for the given ID if one is registered, otherwise nullptr.
|
inline |
|
static |
Utility function that returns if the given string is a valid dialect namespace.
|
inlinevirtual |
Registered hook to materialize a single constant operation from a given attribute value with the desired resultant type. This method should use the provided builder to create the operation without changing the insertion position. The generated operation is expected to be constant like, i.e. single result, zero operands, non side-effecting, etc. On success, this hook should return the value generated to represent the constant value. Otherwise, it should return null on failure.
Reimplemented in mlir::spirv::SPIRVDialect, mlir::AffineOpsDialect, mlir::StandardOpsDialect, and mlir::vector::VectorOpsDialect.
|
virtual |
Parse an attribute registered to this dialect.
Parse an attribute registered to this dialect. If 'type' is nonnull, it refers to the expected type of the attribute.
|
virtual |
Parse a type registered to this dialect.
Reimplemented in mlir::LLVM::LLVMDialect, mlir::spirv::SPIRVDialect, mlir::linalg::LinalgDialect, and mlir::quant::QuantizationDialect.
|
inlinevirtual |
Print an attribute registered to this dialect. Note: The type of the attribute need not be printed by this method as it is always printed by the caller.
|
inlinevirtual |
Print a type registered to this dialect.
Reimplemented in mlir::LLVM::LLVMDialect, mlir::spirv::SPIRVDialect, mlir::linalg::LinalgDialect, and mlir::quant::QuantizationDialect.
|
inlinevirtual |
Verify an attribute from this dialect on the given operation. Returns failure if the verification failed, success otherwise.
Reimplemented in mlir::gpu::GPUDialect, and mlir::spirv::SPIRVDialect.
|
virtual |
Verify an attribute from this dialect on the argument at 'argIndex' for the region at 'regionIndex' on the given operation. Returns failure if the verification failed, success otherwise. This hook may optionally be invoked from any operation containing a region.
Reimplemented in mlir::LLVM::LLVMDialect, and mlir::spirv::SPIRVDialect.
|
virtual |
Verify an attribute from this dialect on the result at 'resultIndex' for the region at 'regionIndex' on the given operation. Returns failure if the verification failed, success otherwise. This hook may optionally be invoked from any operation containing a region.
Reimplemented in mlir::spirv::SPIRVDialect.
DialectConstantFoldHook mlir::Dialect::constantFoldHook |
Registered fallback constant fold hook for the dialect. Like the constant fold hook of each operation, it attempts to constant fold the operation with the specified constant operand values - the elements in "operands" will correspond directly to the operands of the operation, but may be null if non-constant. If constant folding is successful, this fills in the results
vector. If not, this returns failure and results
is unspecified.
DialectConstantDecodeHook mlir::Dialect::decodeHook |
Registered hook to decode opaque constants associated with this dialect. The hook function attempts to decode an opaque constant tensor into a tensor with non-opaque content. If decoding is successful, this method returns false and sets 'output' attribute. If not, it returns true and leaves 'output' unspecified. The default hook fails to decode.
DialectExtractElementHook mlir::Dialect::extractElementHook |
Registered hook to extract an element from an opaque constant associated with this dialect. If element has been successfully extracted, this method returns that element. If not, it returns an empty attribute. The default hook fails to extract an element.