MLIR  14.0.0git
Public Member Functions | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for mlir::LLVMTranslationDialectInterface:
Collaboration graph
[legend]

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. More...
 
virtual LogicalResult amendOperation (Operation *op, 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). 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 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 35 of file LLVMTranslationInterface.h.

Constructor & Destructor Documentation

◆ LLVMTranslationDialectInterface()

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

Member Function Documentation

◆ amendOperation()

virtual LogicalResult mlir::LLVMTranslationDialectInterface::amendOperation ( Operation op,
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 55 of file LLVMTranslationInterface.h.

References mlir::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 43 of file LLVMTranslationInterface.h.

References mlir::failure().

Referenced by mlir::LLVM::detail::createIntrinsicCall().


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