MLIR  18.0.0git
Public Member Functions | List of all members
mlir::LLVMImportDialectInterface Class Reference

Base class for dialect interfaces used to import LLVM IR. More...

#include "mlir/Target/LLVMIR/LLVMImportInterface.h"

+ Inheritance diagram for mlir::LLVMImportDialectInterface:

Public Member Functions

 LLVMImportDialectInterface (Dialect *dialect)
 
virtual LogicalResult convertIntrinsic (OpBuilder &builder, llvm::CallInst *inst, LLVM::ModuleImport &moduleImport) const
 Hook for derived dialect interfaces to implement the import of intrinsics into MLIR. More...
 
virtual LogicalResult setMetadataAttrs (OpBuilder &builder, unsigned kind, llvm::MDNode *node, Operation *op, LLVM::ModuleImport &moduleImport) const
 Hook for derived dialect interfaces to implement the import of metadata into MLIR. More...
 
virtual ArrayRef< unsigned > getSupportedIntrinsics () const
 Hook for derived dialect interfaces to publish the supported intrinsics. More...
 
virtual ArrayRef< unsigned > getSupportedMetadata () const
 Hook for derived dialect interfaces to publish the supported metadata kinds. More...
 

Additional Inherited Members

- Public Types inherited from mlir::detail::DialectInterfaceBase< ConcreteType, BaseT >
using Base = DialectInterfaceBase< ConcreteType, BaseT >
 
- Static Public Member Functions inherited from mlir::detail::DialectInterfaceBase< ConcreteType, BaseT >
static TypeID getInterfaceID ()
 Get a unique id for the derived interface type. More...
 
- Protected Member Functions inherited from mlir::detail::DialectInterfaceBase< ConcreteType, BaseT >
 DialectInterfaceBase (Dialect *dialect)
 

Detailed Description

Base class for dialect interfaces used to import LLVM IR.

Dialects that can be imported should provide an implementation of this interface for the supported intrinsics. The interface may be implemented in a separate library to avoid the "main" dialect library depending on LLVM IR. The interface can be attached using the delayed registration mechanism available in DialectRegistry.

Definition at line 42 of file LLVMImportInterface.h.

Constructor & Destructor Documentation

◆ LLVMImportDialectInterface()

mlir::LLVMImportDialectInterface::LLVMImportDialectInterface ( Dialect dialect)
inline

Definition at line 45 of file LLVMImportInterface.h.

Member Function Documentation

◆ convertIntrinsic()

virtual LogicalResult mlir::LLVMImportDialectInterface::convertIntrinsic ( OpBuilder builder,
llvm::CallInst *  inst,
LLVM::ModuleImport moduleImport 
) const
inlinevirtual

Hook for derived dialect interfaces to implement the import of intrinsics into MLIR.

Definition at line 50 of file LLVMImportInterface.h.

References mlir::failure().

Referenced by mlir::LLVMImportInterface::convertIntrinsic().

◆ getSupportedIntrinsics()

virtual ArrayRef<unsigned> mlir::LLVMImportDialectInterface::getSupportedIntrinsics ( ) const
inlinevirtual

Hook for derived dialect interfaces to publish the supported intrinsics.

As every LLVM IR intrinsic has a unique integer identifier, the function returns the list of supported intrinsic identifiers.

Definition at line 67 of file LLVMImportInterface.h.

Referenced by mlir::LLVMImportInterface::initializeImport().

◆ getSupportedMetadata()

virtual ArrayRef<unsigned> mlir::LLVMImportDialectInterface::getSupportedMetadata ( ) const
inlinevirtual

Hook for derived dialect interfaces to publish the supported metadata kinds.

As every metadata kind has a unique integer identifier, the function returns the list of supported metadata identifiers.

Definition at line 72 of file LLVMImportInterface.h.

◆ setMetadataAttrs()

virtual LogicalResult mlir::LLVMImportDialectInterface::setMetadataAttrs ( OpBuilder builder,
unsigned  kind,
llvm::MDNode *  node,
Operation op,
LLVM::ModuleImport moduleImport 
) const
inlinevirtual

Hook for derived dialect interfaces to implement the import of metadata into MLIR.

Attaches the converted metadata kind and node to the provided operation.

Definition at line 59 of file LLVMImportInterface.h.


The documentation for this class was generated from the following file: