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>();
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.
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.