[llvm-branch-commits] [mlir] 2c66b6e - [mlir][Linalg] NFC - Expose tiling canonicalization patterns through a populate method

Nicolas Vasilache via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Dec 4 07:06:29 PST 2020


Author: Nicolas Vasilache
Date: 2020-12-04T14:57:29Z
New Revision: 2c66b6ec09ddf30b49563ff8fd961e5edbfc0b88

URL: https://github.com/llvm/llvm-project/commit/2c66b6ec09ddf30b49563ff8fd961e5edbfc0b88
DIFF: https://github.com/llvm/llvm-project/commit/2c66b6ec09ddf30b49563ff8fd961e5edbfc0b88.diff

LOG: [mlir][Linalg] NFC - Expose tiling canonicalization patterns through a populate method

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
index 90c6a0374e94..dc82569aac38 100644
--- a/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
@@ -387,6 +387,8 @@ struct LinalgTilingOptions {
 /// when tiling is called programmatically.
 OwningRewritePatternList
 getLinalgTilingCanonicalizationPatterns(MLIRContext *ctx);
+void populateLinalgTilingCanonicalizationPatterns(
+    OwningRewritePatternList &patterns, MLIRContext *ctx);
 
 struct LinalgBaseTilingPattern : public RewritePattern {
   // Entry point to match any LinalgOp OpInterface.

diff  --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
index 2fd7597e9b10..50a18d4fb01c 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
@@ -554,6 +554,12 @@ class RewritePatternList<OpTy, OpTypes...> {
 OwningRewritePatternList
 mlir::linalg::getLinalgTilingCanonicalizationPatterns(MLIRContext *ctx) {
   OwningRewritePatternList patterns;
+  populateLinalgTilingCanonicalizationPatterns(patterns, ctx);
+  return patterns;
+}
+
+void mlir::linalg::populateLinalgTilingCanonicalizationPatterns(
+    OwningRewritePatternList &patterns, MLIRContext *ctx) {
   AffineApplyOp::getCanonicalizationPatterns(patterns, ctx);
   AffineForOp::getCanonicalizationPatterns(patterns, ctx);
   AffineMinOp::getCanonicalizationPatterns(patterns, ctx);
@@ -569,7 +575,6 @@ mlir::linalg::getLinalgTilingCanonicalizationPatterns(MLIRContext *ctx) {
 #define GET_OP_LIST
 #include "mlir/Dialect/Linalg/IR/LinalgStructuredOps.cpp.inc"
       >::insert(patterns, ctx);
-  return patterns;
 }
 
 /// Populate the given list with patterns that apply Linalg tiling.


        


More information about the llvm-branch-commits mailing list