diff --git a/mlir/test/Dialect/Linalg/transform-patterns.mlir b/mlir/test/Dialect/Linalg/transform-patterns.mlir --- a/mlir/test/Dialect/Linalg/transform-patterns.mlir +++ b/mlir/test/Dialect/Linalg/transform-patterns.mlir @@ -1,7 +1,8 @@ // RUN: mlir-opt %s -test-linalg-transform-patterns | FileCheck %s -// CHECK-DAG: #[[STRIDED_1D:.*]] = affine_map<(d0)[s0] -> (d0 + s0)> -// CHECK-DAG: #[[STRIDED_2D:.*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1)> +// CHECK-DAG: #[[STRIDED_1D:.*]] = affine_map<(d0)[s0, s1] -> (d0 * s1 + s0)> +// CHECK-DAG: #[[STRIDED_2D_1:.*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1)> +// CHECK-DAG: #[[STRIDED_2D:.*]] = affine_map<(d0, d1)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2)> // CHECK-DAG: #[[mk:.*]] = affine_map<(d0, d1, d2) -> (d0, d2)> // CHECK-DAG: #[[kn:.*]] = affine_map<(d0, d1, d2) -> (d2, d1)> // CHECK-DAG: #[[mn:.*]] = affine_map<(d0, d1, d2) -> (d0, d1)> @@ -17,18 +18,19 @@ return } // CHECK-LABEL: func @dot -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c8:.*]] = constant 8 : index -// CHECK-DAG : %[[c8000:.*]] = constant 8000 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c1]] { -// CHECK : load -// CHECK : load -// CHECK : mulf -// CHECK : load -// CHECK : addf -// CHECK : store +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c1:.*]] = constant 1 : index +// CHECK-DAG: %[[c8:.*]] = constant 8 : index +// CHECK-DAG: %[[c8000:.*]] = constant 8000 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c1]] { +// CHECK: load +// CHECK: load +// CHECK: mulf +// CHECK: load +// CHECK: addf +// CHECK: store func @matvec(%A: memref, %x: memref, @@ -39,12 +41,12 @@ return } // CHECK-LABEL: func @matvec -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c5:.*]] = constant 5 : index -// CHECK-DAG : %[[c6:.*]] = constant 6 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c5]] -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c6]] -// CHECK : linalg.matvec({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c5:.*]] = constant 5 : index +// CHECK-DAG: %[[c6:.*]] = constant 6 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c5]] +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c6]] +// CHECK: linalg.matvec({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref func @matmul(%A: memref, %B: memref, @@ -55,32 +57,32 @@ return } // CHECK-LABEL: func @matmul -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c2:.*]] = constant 2 : index -// CHECK-DAG : %[[c3:.*]] = constant 3 : index -// CHECK-DAG : %[[c4:.*]] = constant 4 : index -// CHECK-DAG : %[[c20:.*]] = constant 20 : index -// CHECK-DAG : %[[c30:.*]] = constant 30 : index -// CHECK-DAG : %[[c40:.*]] = constant 40 : index -// CHECK-DAG : %[[c200:.*]] = constant 200 : index -// CHECK-DAG : %[[c300:.*]] = constant 300 : index -// CHECK-DAG : %[[c400:.*]] = constant 400 : index -// CHECK-DAG : %[[c2000:.*]] = constant 2000 : index -// CHECK-DAG : %[[c3000:.*]] = constant 3000 : index -// CHECK-DAG : %[[c4000:.*]] = constant 4000 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c200]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c300]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c400]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c20]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c30]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c40]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4]] { -// CHECK : linalg.matmul({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c2:.*]] = constant 2 : index +// CHECK-DAG: %[[c3:.*]] = constant 3 : index +// CHECK-DAG: %[[c4:.*]] = constant 4 : index +// CHECK-DAG: %[[c20:.*]] = constant 20 : index +// CHECK-DAG: %[[c30:.*]] = constant 30 : index +// CHECK-DAG: %[[c40:.*]] = constant 40 : index +// CHECK-DAG: %[[c200:.*]] = constant 200 : index +// CHECK-DAG: %[[c300:.*]] = constant 300 : index +// CHECK-DAG: %[[c400:.*]] = constant 400 : index +// CHECK-DAG: %[[c2000:.*]] = constant 2000 : index +// CHECK-DAG: %[[c3000:.*]] = constant 3000 : index +// CHECK-DAG: %[[c4000:.*]] = constant 4000 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c200]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c300]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c400]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c20]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c30]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c40]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4]] { +// CHECK: linalg.matmul({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref #some_generic_trait = { args_in = 1, @@ -122,47 +124,47 @@ return } // CHECK-LABEL: func @fusion_test -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c2:.*]] = constant 2 : index -// CHECK-DAG : %[[c3:.*]] = constant 3 : index -// CHECK-DAG : %[[c4:.*]] = constant 4 : index -// CHECK-DAG : %[[c20:.*]] = constant 20 : index -// CHECK-DAG : %[[c30:.*]] = constant 30 : index -// CHECK-DAG : %[[c40:.*]] = constant 40 : index -// CHECK-DAG : %[[c100:.*]] = constant 100 : index -// CHECK-DAG : %[[c150:.*]] = constant 150 : index -// CHECK-DAG : %[[c200:.*]] = constant 200 : index -// CHECK-DAG : %[[c300:.*]] = constant 300 : index -// CHECK-DAG : %[[c400:.*]] = constant 400 : index -// CHECK-DAG : %[[c2000:.*]] = constant 2000 : index -// CHECK-DAG : %[[c3000:.*]] = constant 3000 : index -// CHECK-DAG : %[[c4000:.*]] = constant 4000 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c200]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c300]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c400]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c20]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c30]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c40]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4]] { -// CHECK : linalg.matmul({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c2:.*]] = constant 2 : index +// CHECK-DAG: %[[c3:.*]] = constant 3 : index +// CHECK-DAG: %[[c4:.*]] = constant 4 : index +// CHECK-DAG: %[[c20:.*]] = constant 20 : index +// CHECK-DAG: %[[c30:.*]] = constant 30 : index +// CHECK-DAG: %[[c40:.*]] = constant 40 : index +// CHECK-DAG: %[[c100:.*]] = constant 100 : index +// CHECK-DAG: %[[c150:.*]] = constant 150 : index +// CHECK-DAG: %[[c200:.*]] = constant 200 : index +// CHECK-DAG: %[[c300:.*]] = constant 300 : index +// CHECK-DAG: %[[c400:.*]] = constant 400 : index +// CHECK-DAG: %[[c2000:.*]] = constant 2000 : index +// CHECK-DAG: %[[c3000:.*]] = constant 3000 : index +// CHECK-DAG: %[[c4000:.*]] = constant 4000 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c200]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c300]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c400]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c20]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c30]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c40]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4]] { +// CHECK: linalg.matmul({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref // -// CHECK : linalg.generic +// CHECK: linalg.generic // -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c100]] { -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c150]] { -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c2]] { -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c3]] { -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c4]] { -// CHECK : linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c2]] { -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c3]] { -// CHECK : loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c4]] { -// CHECK : linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c100]] { +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c150]] { +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c2]] { +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c3]] { +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c4]] { +// CHECK: linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c2]] { +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c3]] { +// CHECK: loop.for %{{.*}} = %[[c0]] to %{{.*}} step %[[c4]] { +// CHECK: linalg.matmul(%{{.*}}, %{{.*}}, %{{.*}}) : memref, memref, memref #matmul_trait = { args_in = 2, @@ -237,15 +239,14 @@ memref return } -// CHECK-LABEL : func @fma -// CHECK-LABEL : func @permute_generic -// CHECK : linalg.generic {args_in = 2, args_out = 1, -// CHECK-SAME : indexing_maps = [#[[kn]], #[[nm]], #[[km]]], -// CHECK-SAME : iterator_types = ["parallel", "reduction", "parallel"], -// CHECK-SAME : library_call = "linalg_matmul"} %{{.*}}, %{{.*}}, %{{.*}} -// CHECK : memref, -// CHECK-SAME : memref, -// CHECK-SAME : memref +// CHECK-LABEL: func @permute_generic +// CHECK: linalg.generic {args_in = 2 : i64, args_out = 1 : i64, +// CHECK-SAME: indexing_maps = [#[[kn]], #[[nm]], #[[km]]], +// CHECK-SAME: iterator_types = ["parallel", "reduction", "parallel"], +// CHECK-SAME: library_call = "linalg_matmul"} %{{.*}}, %{{.*}}, %{{.*}} +// CHECK: memref, +// CHECK-SAME: memref, +// CHECK-SAME: memref #indexed_matmul_trait = { args_in = 2, @@ -268,15 +269,14 @@ memref return } -// CHECK-LABEL : func @fma_indexed -// CHECK-LABEL : func @permute_generic_indexed -// CHECK : linalg.indexed_generic {args_in = 2, args_out = 1, -// CHECK-SAME : indexing_maps = [#[[kn]], #[[nm]], #[[km]]], -// CHECK-SAME : iterator_types = ["parallel", "reduction", "parallel"], -// CHECK-SAME : library_call = "linalg_matmul_indexed"} %{{.*}}, %{{.*}}, %{{.*}} : -// CHECK : memref, -// CHECK-SAME : memref, -// CHECK-SAME : memref +// CHECK-LABEL: func @permute_generic_indexed +// CHECK: linalg.indexed_generic {args_in = 2 : i64, args_out = 1 : i64, +// CHECK-SAME: indexing_maps = [#[[kn]], #[[nm]], #[[km]]], +// CHECK-SAME: iterator_types = ["parallel", "reduction", "parallel"], +// CHECK-SAME: library_call = "linalg_matmul_indexed"} %{{.*}}, %{{.*}}, %{{.*}} +// CHECK: memref, +// CHECK-SAME: memref, +// CHECK-SAME: memref func @dot_perm(%x: memref, %y: memref, @@ -288,12 +288,12 @@ return } // CHECK-LABEL: func @dot_perm -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c8:.*]] = constant 8 : index -// CHECK-DAG : %[[c8000:.*]] = constant 8000 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8]] { -// CHECK : linalg.dot({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c8:.*]] = constant 8 : index +// CHECK-DAG: %[[c8000:.*]] = constant 8000 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c8]] { +// CHECK: linalg.dot({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref func @matvec_perm(%A: memref, %x: memref, @@ -305,12 +305,12 @@ return } // CHECK-LABEL: func @matvec_perm -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c5:.*]] = constant 5 : index -// CHECK-DAG : %[[c6:.*]] = constant 6 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c6]] -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c5]] -// CHECK : linalg.matvec({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c5:.*]] = constant 5 : index +// CHECK-DAG: %[[c6:.*]] = constant 6 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c6]] +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c5]] +// CHECK: linalg.matvec({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref func @matmul_perm(%A: memref, %B: memref, @@ -322,29 +322,26 @@ return } // CHECK-LABEL: func @matmul_perm -// CHECK-DAG : %[[c0:.*]] = constant 0 : index -// CHECK-DAG : %[[c2:.*]] = constant 2 : index -// CHECK-DAG : %[[c3:.*]] = constant 3 : index -// CHECK-DAG : %[[c4:.*]] = constant 4 : index -// CHECK-DAG : %[[c20:.*]] = constant 20 : index -// CHECK-DAG : %[[c30:.*]] = constant 30 : index -// CHECK-DAG : %[[c40:.*]] = constant 40 : index -// CHECK-DAG : %[[c200:.*]] = constant 200 : index -// CHECK-DAG : %[[c300:.*]] = constant 300 : index -// CHECK-DAG : %[[c400:.*]] = constant 400 : index -// CHECK-DAG : %[[c2000:.*]] = constant 2000 : index -// CHECK-DAG : %[[c3000:.*]] = constant 3000 : index -// CHECK-DAG : %[[c4000:.*]] = constant 4000 : index -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c300]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c200]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c400]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c20]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c30]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c40]] { -// CHECK : linalg.matmul({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref +// CHECK-DAG: %[[c0:.*]] = constant 0 : index +// CHECK-DAG: %[[c20:.*]] = constant 20 : index +// CHECK-DAG: %[[c30:.*]] = constant 30 : index +// CHECK-DAG: %[[c40:.*]] = constant 40 : index +// CHECK-DAG: %[[c200:.*]] = constant 200 : index +// CHECK-DAG: %[[c300:.*]] = constant 300 : index +// CHECK-DAG: %[[c400:.*]] = constant 400 : index +// CHECK-DAG: %[[c2000:.*]] = constant 2000 : index +// CHECK-DAG: %[[c3000:.*]] = constant 3000 : index +// CHECK-DAG: %[[c4000:.*]] = constant 4000 : index +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c300]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c200]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c400]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c20]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c30]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c40]] { +// CHECK: linalg.matmul({{.*}}, {{.*}}, {{.*}}) : memref, memref, memref func @promote_subview_matmul(%arg0: memref, %arg1: memref, @@ -360,11 +357,11 @@ loop.for %arg3 = %c0 to %0 step %c2000 { loop.for %arg4 = %c0 to %2 step %c3000 { loop.for %arg5 = %c0 to %1 step %c4000 { - %3 = std.subview %arg0[%arg3, %arg5][%c2000, %c4000][%c1, %c1] : + %3 = subview %arg0[%arg3, %arg5][%c2000, %c4000][%c1, %c1] : memref to memref - %4 = std.subview %arg1[%arg5, %arg4][%c4000, %c3000][%c1, %c1] : + %4 = subview %arg1[%arg5, %arg4][%c4000, %c3000][%c1, %c1] : memref to memref - %5 = std.subview %arg2[%arg3, %arg4][%c2000, %c3000][%c1, %c1] : + %5 = subview %arg2[%arg3, %arg4][%c2000, %c3000][%c1, %c1] : memref to memref linalg.matmul(%3, %4, %5) {__internal_linalg_transform__ = "_promote_views_"} : memref, @@ -376,22 +373,22 @@ return } // CHECK-LABEL: func @promote_subview_matmul -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { -// CHECK : loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { -// CHECK : %[[s0:.*]] = std.subview {{%.*}}[{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref -// CHECK : %[[s1:.*]] = std.subview {{%.*}}[{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref -// CHECK : %[[s2:.*]] = std.subview {{%.*}}[{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref -// CHECK : %[[a0:.*]] = alloc({{%.*}}) : memref -// CHECK : %[[v0:.*]] = std.view %[[a0]][][{{%.*}}, {{%.*}}]: memref to memref -// CHECK : %[[l0:.*]] = linalg.slice %[[v0]][{{%.*}}, {{%.*}}] : memref, !linalg.range, !linalg.range, memref -// CHECK : %[[a1:.*]] = alloc({{%.*}}) : memref -// CHECK : %[[v1:.*]] = std.view %[[a1]][][{{%.*}}, {{%.*}}]: memref to memref -// CHECK : %[[l1:.*]] = linalg.slice %[[v1]][{{%.*}}, {{%.*}}] : memref, !linalg.range, !linalg.range, memref -// CHECK : %[[a2:.*]] = alloc({{%.*}}) : memref -// CHECK : %[[v2:.*]] = std.view %[[a2]][][{{%.*}}, {{%.*}}]: memref to memref -// CHECK : %[[l2:.*]] = linalg.slice %[[v2]][{{%.*}}, {{%.*}}] : memref, !linalg.range, !linalg.range, memref -// CHECK : linalg.copy(%[[s0]], %[[l0]]) : memref, memref -// CHECK : linalg.copy(%[[s1]], %[[l1]]) : memref, memref -// CHECK : linalg.copy(%[[s2]], %[[l2]]) : memref, memref -// CHECK : linalg.matmul(%[[v0]], %[[v1]], %[[v2]]) : memref, memref, memref +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c2000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c3000]] { +// CHECK: loop.for {{.*}} = %[[c0]] to {{.*}} step %[[c4000]] { +// CHECK: %[[s0:.*]] = subview {{%.*}}[{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[s1:.*]] = subview {{%.*}}[{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[s2:.*]] = subview {{%.*}}[{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[a0:.*]] = alloc({{%.*}}) : memref +// CHECK: %[[v0:.*]] = std.view %[[a0]][][{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[l0:.*]] = subview %[[v0]][{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[a1:.*]] = alloc({{%.*}}) : memref +// CHECK: %[[v1:.*]] = std.view %[[a1]][][{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[l1:.*]] = subview %[[v1]][{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[a2:.*]] = alloc({{%.*}}) : memref +// CHECK: %[[v2:.*]] = std.view %[[a2]][][{{%.*}}, {{%.*}}] : memref to memref +// CHECK: %[[l2:.*]] = subview %[[v2]][{{%.*}}, {{%.*}}] [{{%.*}}, {{%.*}}] : memref to memref +// CHECK: linalg.copy(%[[s0]], %[[l0]]) : memref, memref +// CHECK: linalg.copy(%[[s1]], %[[l1]]) : memref, memref +// CHECK: linalg.copy(%[[s2]], %[[l2]]) : memref, memref +// CHECK: linalg.matmul(%[[v0]], %[[v1]], %[[v2]]) : memref, memref, memref