MLIR  20.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:

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, 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). More...
 
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. 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 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.

◆ 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.


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