MLIR
18.0.0git
|
Interface collection for the import of LLVM IR that dispatches to a concrete dialect interface implementation. More...
#include "mlir/Target/LLVMIR/LLVMImportInterface.h"
Public Member Functions | |
LogicalResult | initializeImport () |
Queries all registered dialect interfaces for the supported LLVM IR intrinsic and metadata kinds and builds the dispatch tables for the conversion. More... | |
LogicalResult | convertIntrinsic (OpBuilder &builder, llvm::CallInst *inst, LLVM::ModuleImport &moduleImport) const |
Converts the LLVM intrinsic to an MLIR operation if a conversion exists. More... | |
bool | isConvertibleIntrinsic (llvm::Intrinsic::ID id) |
Returns true if the given LLVM IR intrinsic is convertible to an MLIR operation. More... | |
LogicalResult | setMetadataAttrs (OpBuilder &builder, unsigned kind, llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport) const |
Attaches the given LLVM metadata to the imported operation if a conversion to one or more MLIR dialect attributes exists and succeeds. More... | |
bool | isConvertibleMetadata (unsigned kind) |
Returns true if the given LLVM IR metadata is convertible to an MLIR attribute. More... | |
![]() | |
DialectInterfaceCollection (MLIRContext *ctx) | |
Collect the registered dialect interfaces within the provided context. More... | |
const LLVMImportDialectInterface * | getInterfaceFor (Object *obj) const |
Get the interface for a given object, or null if one is not registered. More... | |
iterator | begin () const |
iterator | end () const |
![]() | |
DialectInterfaceCollectionBase (MLIRContext *ctx, TypeID interfaceKind, StringRef interfaceName) | |
virtual | ~DialectInterfaceCollectionBase () |
Additional Inherited Members | |
![]() | |
using | Base = DialectInterfaceCollection< LLVMImportDialectInterface > |
using | iterator = detail::DialectInterfaceCollectionBase::iterator< LLVMImportDialectInterface > |
Iterator access to the held interfaces. More... | |
![]() | |
const DialectInterface * | getInterfaceFor (Operation *op) const |
Get the interface for the dialect of given operation, or null if one is not registered. More... | |
const DialectInterface * | getInterfaceFor (Dialect *dialect) const |
Get the interface for the given dialect. More... | |
template<typename InterfaceT > | |
iterator< InterfaceT > | interface_begin () const |
Iterator access to the held interfaces. More... | |
template<typename InterfaceT > | |
iterator< InterfaceT > | interface_end () const |
Interface collection for the import of LLVM IR that dispatches to a concrete dialect interface implementation.
Queries the dialect interfaces to obtain a list of the supported LLVM IR constructs and then builds a mapping for the efficient dispatch.
Definition at line 79 of file LLVMImportInterface.h.
|
inline |
Converts the LLVM intrinsic to an MLIR operation if a conversion exists.
Returns failure otherwise.
Definition at line 116 of file LLVMImportInterface.h.
References mlir::LLVMImportDialectInterface::convertIntrinsic(), mlir::failure(), and mlir::DialectInterfaceCollection< LLVMImportDialectInterface >::getInterfaceFor().
|
inline |
Queries all registered dialect interfaces for the supported LLVM IR intrinsic and metadata kinds and builds the dispatch tables for the conversion.
Returns failure if multiple dialect interfaces translate the same LLVM IR intrinsic.
Definition at line 88 of file LLVMImportInterface.h.
References mlir::emitError(), mlir::get(), and mlir::LLVMImportDialectInterface::getSupportedIntrinsics().
Referenced by mlir::LLVM::ModuleImport::initializeImportInterface().
|
inline |
Returns true if the given LLVM IR intrinsic is convertible to an MLIR operation.
Definition at line 131 of file LLVMImportInterface.h.
Referenced by mlir::LLVM::ModuleImport::processFunction().
|
inline |
Returns true if the given LLVM IR metadata is convertible to an MLIR attribute.
Definition at line 163 of file LLVMImportInterface.h.
|
inline |
Attaches the given LLVM metadata to the imported operation if a conversion to one or more MLIR dialect attributes exists and succeeds.
Returns success if at least one of the conversions is successful and failure if all of them fail.
Definition at line 139 of file LLVMImportInterface.h.