13 #ifndef MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H
14 #define MLIR_TARGET_LLVMIR_LLVMTRANSLATIONINTERFACE_H
27 class ModuleTranslation;
87 return iface->convertOperation(op, builder, moduleTranslation);
99 return iface->amendOperation(op, instructions, attribute,
107 virtual LogicalResult
113 return iface->convertParameterAttr(
function, argIdx, attribute,
116 function.emitWarning(
"Unhandled parameter attribute '" +
117 attribute.
getName().str() +
"'");
A collection of dialect interfaces within a context, for a given concrete interface type.
DialectInterfaceCollection< LLVMTranslationDialectInterface > Base
const LLVMTranslationDialectInterface * getInterfaceFor(Object *obj) const
Get the interface for a given object, or null if one is not registered.
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
Base class for dialect interfaces providing translation to LLVM IR.
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...
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 derive...
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.
LLVMTranslationDialectInterface(Dialect *dialect)
Interface collection for translation to LLVM IR, dispatches to a concrete interface implementation ba...
virtual LogicalResult convertParameterAttr(LLVM::LLVMFuncOp function, int argIdx, NamedAttribute attribute, LLVM::ModuleTranslation &moduleTranslation) const
Acts on the given function operation using the interface implemented by the dialect of one of the fun...
virtual LogicalResult amendOperation(Operation *op, ArrayRef< llvm::Instruction * > instructions, NamedAttribute attribute, LLVM::ModuleTranslation &moduleTranslation) const
Acts on the given operation using the interface implemented by the dialect of one of the operation's ...
virtual LogicalResult convertOperation(Operation *op, llvm::IRBuilderBase &builder, LLVM::ModuleTranslation &moduleTranslation) const
Translates the given operation to LLVM IR using the interface implemented by the op's dialect.
Implementation class for module translation.
NamedAttribute represents a combination of a name and an Attribute value.
StringAttr getName() const
Return the name of the attribute.
Dialect * getNameDialect() const
Return the dialect of the name of this attribute, if the name is prefixed by a dialect namespace.
Operation is the basic unit of execution within MLIR.
The base class used for all derived interface types.
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Include the generated interface declarations.