20 #define GEN_PASS_DEF_CONVERTMEMREFTOSPIRV
21 #include "mlir/Conversion/Passes.h.inc"
28 class ConvertMemRefToSPIRVPass
29 :
public impl::ConvertMemRefToSPIRVBase<ConvertMemRefToSPIRVPass> {
30 void runOnOperation()
override;
34 void ConvertMemRefToSPIRVPass::runOnOperation() {
39 std::unique_ptr<ConversionTarget> target =
43 options.boolNumBits = this->boolNumBits;
44 options.use64bitIndex = this->use64bitIndex;
49 target->addLegalOp<UnrealizedConversionCastOp>();
55 return signalPassFailure();
59 return std::make_unique<ConvertMemRefToSPIRVPass>();
static MLIRContext * getContext(OpFoldResult val)
static llvm::ManagedStatic< PassManagerOptions > options
MLIRContext is the top-level object for a collection of MLIR operations.
Operation is the basic unit of execution within MLIR.
static std::unique_ptr< SPIRVConversionTarget > get(spirv::TargetEnvAttr targetAttr)
Creates a SPIR-V conversion target for the given target environment.
Type conversion from builtin types to SPIR-V types for shader interface.
TargetEnvAttr lookupTargetEnvOrDefault(Operation *op)
Queries the target environment recursively from enclosing symbol table ops containing the given op or...
Include the generated interface declarations.
std::unique_ptr< OperationPass<> > createConvertMemRefToSPIRVPass()
Creates a pass to convert MemRef ops to SPIR-V ops.
void populateMemRefToSPIRVPatterns(const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
Appends to a pattern list additional patterns for translating MemRef ops to SPIR-V ops.
LogicalResult applyPartialConversion(ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
Below we define several entry points for operation conversion.