[Mlir-commits] [mlir] 2268459 - [mlir][Interfaces] TilingInterface: Add test case for linalg.copy on memrefs
Matthias Springer
llvmlistbot at llvm.org
Tue Jun 20 23:57:05 PDT 2023
Author: Matthias Springer
Date: 2023-06-21T08:52:25+02:00
New Revision: 2268459985093e9fbbcd4f4361455dd4563d4bd1
URL: https://github.com/llvm/llvm-project/commit/2268459985093e9fbbcd4f4361455dd4563d4bd1
DIFF: https://github.com/llvm/llvm-project/commit/2268459985093e9fbbcd4f4361455dd4563d4bd1.diff
LOG: [mlir][Interfaces] TilingInterface: Add test case for linalg.copy on memrefs
Differential Revision: https://reviews.llvm.org/D153347
Added:
Modified:
mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir
mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp
Removed:
################################################################################
diff --git a/mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir b/mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir
index 00a800f7da488..cacef3c47b5e1 100644
--- a/mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir
+++ b/mlir/test/Interfaces/TilingInterface/tile-using-interface.mlir
@@ -273,3 +273,17 @@ func.func @interchange_matmul(%arg0 : tensor<?x?xf32>, %arg1 : tensor<?x?xf32>,
// CHECK: scf.yield %[[INNER2]]
// CHECK: scf.yield %[[INNER1]]
// CHECK: return %[[OUTER]]
+
+// -----
+
+// CHECK-LABEL: func @linalg_copy_matmul(
+// CHECK: scf.for
+// CHECK: scf.for
+// CHECK: memref.subview
+// CHECK: memref.subview
+// CHECK: linalg.copy
+func.func @linalg_copy_matmul(%a: memref<?x?xf32>, %b: memref<?x?xf32>) {
+ linalg.copy {__internal_linalg_transform__ = "simple_copy_memref"}
+ ins(%a : memref<?x?xf32>) outs(%b : memref<?x?xf32>)
+ return
+}
diff --git a/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp b/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp
index dc7286e3bd315..752c885e0b87b 100644
--- a/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp
+++ b/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp
@@ -507,7 +507,8 @@ void TestTilingInterfacePass::addTestPatterns(MLIRContext *context,
addPatternForTiling(context, patterns, "pad_inner_tiling", {0, 3});
// 9. Tiling inner dimension of 2d pad tensor operations.
addPatternForTiling(context, patterns, "pad_outer_tiling", {2, 3});
-
+ // 10. Tiling M and N dims of `linalg.copy` on memrefs.
+ addPatternForTiling(context, patterns, "simple_copy_memref", {10, 20});
return;
}
if (testTileConsumerAndFuseProducer) {
More information about the Mlir-commits
mailing list