12 #include "llvm/ADT/DenseSet.h"
22 if (!dialects.insert(dialect).second)
26 auto *iface = dyn_cast<ConvertToLLVMPatternInterface>(dialect);
29 iface->populateConvertToLLVMConversionPatterns(target, typeConverter,
37 auto iface = dyn_cast<ConvertToLLVMOpInterface>(op);
43 iface.getConvertToLLVMConversionAttrs(attrs);
44 for (ConvertToLLVMAttrInterface attr : attrs)
45 attr.populateConvertToLLVMConversionPatterns(target, typeConverter,
49 #include "mlir/Conversion/ConvertToLLVM/ToLLVMAttrInterface.cpp.inc"
51 #include "mlir/Conversion/ConvertToLLVM/ToLLVMOpInterface.cpp.inc"
This class describes a specific conversion target.
Dialects are groups of MLIR operations, types and attributes, as well as behavior associated with the...
Conversion from types to the LLVM IR dialect.
Operation is the basic unit of execution within MLIR.
Dialect * getDialect()
Return the dialect this operation is associated with, or nullptr if the associated dialect is not loa...
std::enable_if_t< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT > walk(FnT &&callback)
Walk the operation by calling the callback for each nested operation (including this one),...
OpTy getParentOfType()
Return the closest surrounding parent operation that is of type 'OpTy'.
Include the generated interface declarations.
void populateConversionTargetFromOperation(Operation *op, ConversionTarget &target, LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
Recursively walk the IR and collect all dialects implementing the interface, and populate the convers...
const FrozenRewritePatternSet & patterns
void populateOpConvertToLLVMConversionPatterns(Operation *op, ConversionTarget &target, LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
Helper function for populating LLVM conversion patterns.