[mli][linalg] Change tensor size in unit test (NFC).
authorTobias Gysi <gysit@google.com>
Mon, 4 Oct 2021 06:23:53 +0000 (06:23 +0000)
committerTobias Gysi <gysit@google.com>
Mon, 4 Oct 2021 06:43:35 +0000 (06:43 +0000)
As a follow up to https://reviews.llvm.org/D110849, adapt the input tensor size to match the iteration space.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D110906

mlir/test/Dialect/Linalg/tile-and-fuse-on-tensors.mlir

index f53e170..72c780a 100644 (file)
@@ -234,19 +234,25 @@ builtin.func @fuse_indexed(%arg0: tensor<24x12xi32>,
 
 //  CHECK-DAG:  #[[MAP0:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
 //  CHECK-DAG:  #[[MAP1:.*]] = affine_map<(d0, d1) -> (8, -d0 - d1 + 17)>
-//  CHECK-DAG:  #[[MAP2:.*]] = affine_map<(d0, d1, d2) -> (d0, -d1 - d2 + 18)>
+//  CHECK-DAG:  #[[MAP2:.*]] = affine_map<(d0, d1, d2) -> (d0, -d1 - d2 + 17)>
 #map0 = affine_map<(d0, d1) -> (d0, d0 + d1)>
 #map1 = affine_map<(d0, d1) -> (d0, d1)>
 
 //      CHECK:  fuse_non_rectangular
-// CHECK-SAME:    %[[ARG0:[0-9a-zA-Z]*]]: tensor<10x18xf32>
-func @fuse_non_rectangular(%arg0: tensor<10x18xf32>,
+// CHECK-SAME:    %[[ARG0:[0-9a-zA-Z]*]]: tensor<10x17xf32>
+func @fuse_non_rectangular(%arg0: tensor<10x17xf32>,
                            %arg1: tensor<10x8xf32>) -> tensor<10x8xf32> {
+
+  //  CHECK-DAG:  %[[C0:.*]] = constant 0 : index
+  //  CHECK-DAG:  %[[C4:.*]] = constant 4 : index
+  //  CHECK-DAG:  %[[C5:.*]] = constant 5 : index
+  //  CHECK-DAG:  %[[C8:.*]] = constant 8 : index
+  //  CHECK-DAG:  %[[C10:.*]] = constant 10 : index
   %cst = constant 0.000000e+00 : f32
-  %0 = linalg.fill(%cst, %arg0) : f32, tensor<10x18xf32> -> tensor<10x18xf32>
+  %0 = linalg.fill(%cst, %arg0) : f32, tensor<10x17xf32> -> tensor<10x17xf32>
 
-  //      CHECK:  scf.for %[[IV0:[0-9a-zA-Z]*]] = %c0 to %c8 step %c4
-  //      CHECK:    scf.for %[[IV1:[0-9a-zA-Z]*]] = %c0 to %c10 step %c5
+  //      CHECK:  scf.for %[[IV0:[0-9a-zA-Z]*]] = %[[C0]] to %[[C8]] step %[[C4]]
+  //      CHECK:    scf.for %[[IV1:[0-9a-zA-Z]*]] = %[[C0]] to %[[C10]] step %[[C5]]
 
   // Compute producer on a hyper rectangular bounding box. Along the second dimenson,
   // the offset is set to the sum of the induction variables, and the upper bound
@@ -259,7 +265,7 @@ func @fuse_non_rectangular(%arg0: tensor<10x18xf32>,
   // CHECK-SAME:                                        %[[IV1]], %[[SUM]]
   // CHECK-SAME:                                                , %[[UB1]]
   //      CHECK:      %[[T1:.*]] = linalg.fill(%{{.*}}, %[[T0]])
-  %1 = linalg.generic {indexing_maps = [#map0, #map1], iterator_types = ["parallel", "parallel"]} ins(%0 : tensor<10x18xf32>) outs(%arg1 : tensor<10x8xf32>) {
+  %1 = linalg.generic {indexing_maps = [#map0, #map1], iterator_types = ["parallel", "parallel"]} ins(%0 : tensor<10x17xf32>) outs(%arg1 : tensor<10x8xf32>) {
   ^bb0(%arg2: f32, %arg3: f32):  // no predecessors
     %2 = addf %arg2, %arg3 : f32
     linalg.yield %2 : f32