MLIR 22.0.0git
mlir::LLVMTranslationDialectInterface Class Reference

Base class for dialect interfaces providing translation to LLVM IR. More...

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

Inheritance diagram for mlir::LLVMTranslationDialectInterface:

Public Member Functions

 LLVMTranslationDialectInterface (Dialect *dialect)
virtual LogicalResult convertOperation (Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) const
 Hook for derived dialect interface to provide translation of the operations to LLVM IR.
virtual LogicalResult amendOperation (Operation *op, ArrayRef< llvm::Instruction * > instructions, NamedAttribute attribute, LLVM::ModuleTranslation &moduleTranslation) const
 Hook for derived dialect interface to act on an operation that has dialect attributes from the derived dialect (the operation itself may be from a different dialect).
virtual LogicalResult convertParameterAttr (LLVM::LLVMFuncOp function, int argIdx, NamedAttribute attr, LLVM::ModuleTranslation &moduleTranslation) const
 Hook for derived dialect interface to translate or act on a derived dialect attribute that appears on a function parameter.
Public Member Functions inherited from mlir::DialectInterface
virtual ~DialectInterface ()
DialectgetDialect () const
 Return the dialect that this interface represents.
MLIRContextgetContext () const
 Return the context that holds the parent dialect of this interface.
TypeID getID () const
 Return the derived interface id.

Additional Inherited Members

Public Types inherited from mlir::detail::DialectInterfaceBase< ConcreteType, DialectInterface >
using Base
Public Types inherited from mlir::DialectInterface
template<typename ConcreteType>
using Base = detail::DialectInterfaceBase<ConcreteType, DialectInterface>
 The base class used for all derived interface types.
Static Public Member Functions inherited from mlir::detail::DialectInterfaceBase< ConcreteType, DialectInterface >
static TypeID getInterfaceID ()
 Get a unique id for the derived interface type.
Protected Member Functions inherited from mlir::detail::DialectInterfaceBase< ConcreteType, DialectInterface >
 DialectInterfaceBase (Dialect *dialect)
Protected Member Functions inherited from mlir::DialectInterface
 DialectInterface (Dialect *dialect, TypeID id)

Detailed Description

Base class for dialect interfaces providing translation to LLVM IR.

Dialects that can be translated should provide an implementation of this interface for the supported operations. 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 37 of file LLVMTranslationInterface.h.

Constructor & Destructor Documentation

◆ LLVMTranslationDialectInterface()

mlir::LLVMTranslationDialectInterface::LLVMTranslationDialectInterface ( Dialect * dialect)
inline

Definition at line 40 of file LLVMTranslationInterface.h.

Member Function Documentation

◆ amendOperation()

virtual LogicalResult mlir::LLVMTranslationDialectInterface::amendOperation ( Operation * op,
ArrayRef< llvm::Instruction * > instructions,
NamedAttribute attribute,
LLVM::ModuleTranslation & moduleTranslation ) const
inlinevirtual

Hook for derived dialect interface to act on an operation that has dialect attributes from the derived dialect (the operation itself may be from a different dialect).

This gets called after the operation has been translated. The hook is expected to use moduleTranslation to look up the translation results and amend the corresponding IR constructs. Does nothing and succeeds by default.

Definition at line 57 of file LLVMTranslationInterface.h.

References success().

◆ convertOperation()

virtual LogicalResult mlir::LLVMTranslationDialectInterface::convertOperation ( Operation * op,
llvm::IRBuilderBase & builder,
LLVM::ModuleTranslation & moduleTranslation ) const
inlinevirtual

Hook for derived dialect interface to provide translation of the operations to LLVM IR.

Definition at line 45 of file LLVMTranslationInterface.h.

◆ convertParameterAttr()

virtual LogicalResult mlir::LLVMTranslationDialectInterface::convertParameterAttr ( LLVM::LLVMFuncOp function,
int argIdx,
NamedAttribute attr,
LLVM::ModuleTranslation & moduleTranslation ) const
inlinevirtual

Hook for derived dialect interface to translate or act on a derived dialect attribute that appears on a function parameter.

This gets called after the function operation has been translated.

Definition at line 67 of file LLVMTranslationInterface.h.

References success().


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