23 #define GEN_PASS_DEF_CONVERTSPIRVTOLLVMPASS
24 #include "mlir/Conversion/Passes.h.inc"
31 class ConvertSPIRVToLLVMPass
32 :
public impl::ConvertSPIRVToLLVMPassBase<ConvertSPIRVToLLVMPass> {
33 void runOnOperation()
override;
40 void ConvertSPIRVToLLVMPass::runOnOperation() {
42 ModuleOp module = getOperation();
60 target.addIllegalDialect<spirv::SPIRVDialect>();
61 target.addLegalDialect<LLVM::LLVMDialect>();
64 clientAPI != spirv::ClientAPI::Unknown)
65 getOperation()->emitWarning()
66 <<
"address space mapping for client '"
67 << spirv::stringifyClientAPI(clientAPI) <<
"' not implemented";
70 target.addLegalOp<ModuleOp>();
static MLIRContext * getContext(OpFoldResult val)
static llvm::ManagedStatic< PassManagerOptions > options
This class describes a specific conversion target.
Conversion from types to the LLVM IR dialect.
Options to control the LLVM lowering.
MLIRContext is the top-level object for a collection of MLIR operations.
Include the generated interface declarations.
void populateSPIRVToLLVMTypeConversion(LLVMTypeConverter &typeConverter, spirv::ClientAPI clientAPIForAddressSpaceMapping=spirv::ClientAPI::Unknown)
Populates type conversions with additional SPIR-V types.
void populateSPIRVToLLVMFunctionConversionPatterns(const LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
Populates the given list with patterns for function conversion from SPIR-V to LLVM.
void populateSPIRVToLLVMConversionPatterns(const LLVMTypeConverter &typeConverter, RewritePatternSet &patterns, spirv::ClientAPI clientAPIForAddressSpaceMapping=spirv::ClientAPI::Unknown)
Populates the given list with patterns that convert from SPIR-V to LLVM.
void encodeBindAttribute(ModuleOp module)
Encodes global variable's descriptor set and binding into its name if they both exist.
void populateSPIRVToLLVMModuleConversionPatterns(const LLVMTypeConverter &typeConverter, RewritePatternSet &patterns)
Populates the given patterns for module conversion from SPIR-V to LLVM.
LogicalResult applyPartialConversion(ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
Below we define several entry points for operation conversion.