22 #define GEN_PASS_DEF_CONVERTVECTORTOSPIRV
23 #include "mlir/Conversion/Passes.h.inc"
29 struct ConvertVectorToSPIRVPass
30 :
public impl::ConvertVectorToSPIRVBase<ConvertVectorToSPIRVPass> {
31 void runOnOperation()
override;
35 void ConvertVectorToSPIRVPass::runOnOperation() {
40 std::unique_ptr<ConversionTarget> target =
47 target->addLegalOp<UnrealizedConversionCastOp>();
53 return signalPassFailure();
57 return std::make_unique<ConvertVectorToSPIRVPass>();
static MLIRContext * getContext(OpFoldResult val)
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<> > createConvertVectorToSPIRVPass()
Creates a pass to convert Vector Ops to SPIR-V ops.
const FrozenRewritePatternSet & patterns
LogicalResult applyPartialConversion(ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
Below we define several entry points for operation conversion.
void populateVectorToSPIRVPatterns(const SPIRVTypeConverter &typeConverter, RewritePatternSet &patterns)
Appends to a pattern list additional patterns for translating Vector Ops to SPIR-V ops.