21 #define GEN_PASS_DEF_CONVERTTENSORTOLINALG
22 #include "mlir/Conversion/Passes.h.inc"
29 class ConvertTensorToLinalgPass
30 :
public impl::ConvertTensorToLinalgBase<ConvertTensorToLinalgPass> {
31 void runOnOperation()
override {
35 .
addLegalDialect<mlir::arith::ArithDialect, mlir::linalg::LinalgDialect,
36 mlir::tensor::TensorDialect>();
43 std::move(patterns))))
44 return signalPassFailure();
49 std::unique_ptr<OperationPass<ModuleOp>>
51 return std::make_unique<ConvertTensorToLinalgPass>();
static MLIRContext * getContext(OpFoldResult val)
This class describes a specific conversion target.
void addLegalDialect(StringRef name, Names... names)
Register the operations of the given dialects as legal.
void addIllegalOp(OperationName op)
Register the given operation as illegal, i.e.
Include the generated interface declarations.
std::unique_ptr< OperationPass< ModuleOp > > createConvertTensorToLinalgPass()
Creates a pass to convert Tensor ops to Linalg ops.
void populateTensorToLinalgPatterns(RewritePatternSet &patterns)
Appends to a pattern list additional patterns for translating tensor ops to Linalg ops.
LogicalResult applyPartialConversion(ArrayRef< Operation * > ops, const ConversionTarget &target, const FrozenRewritePatternSet &patterns, ConversionConfig config=ConversionConfig())
Below we define several entry points for operation conversion.
bool failed(LogicalResult result)
Utility function that returns true if the provided LogicalResult corresponds to a failure value.