diff --git a/mlir/lib/Dialect/Linalg/TransformOps/DialectExtension.cpp b/mlir/lib/Dialect/Linalg/TransformOps/DialectExtension.cpp --- a/mlir/lib/Dialect/Linalg/TransformOps/DialectExtension.cpp +++ b/mlir/lib/Dialect/Linalg/TransformOps/DialectExtension.cpp @@ -13,9 +13,11 @@ #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.h" #include "mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.h" +#include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Transform/IR/TransformDialect.h" +#include "mlir/Dialect/Transform/IR/TransformOps.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" using namespace mlir; @@ -47,6 +49,22 @@ #define GET_OP_LIST #include "mlir/Dialect/Linalg/TransformOps/LinalgMatchOps.cpp.inc" >(); + + addDialectDataInitializer( + [&](transform::PatternRegistry ®istry) { + registry.registerPatterns( + "linalg.erase_unnecessary_inputs", + linalg::populateEraseUnnecessaryInputsPatterns); + registry.registerPatterns( + "linalg.fold_unit_extent_dims_via_slices", + linalg::populateFoldUnitExtentDimsViaSlicesPatterns); + registry.registerPatterns( + "linalg.fold_unit_extent_dims_via_reshapes", + linalg::populateFoldUnitExtentDimsViaReshapesPatterns); + registry.registerPatterns( + "linalg.tiling_canonicalization", + linalg::populateLinalgTilingCanonicalizationPatterns); + }); } }; } // namespace