Skip to content

Commit 32a7d60

Browse files
author
Tobias Gysi
committed
[mli][linalg] Change tensor size in unit test (NFC).
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
1 parent b06df22 commit 32a7d60

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,25 @@ builtin.func @fuse_indexed(%arg0: tensor<24x12xi32>,
234234

235235
// CHECK-DAG: #[[MAP0:.*]] = affine_map<(d0, d1) -> (d0 + d1)>
236236
// CHECK-DAG: #[[MAP1:.*]] = affine_map<(d0, d1) -> (8, -d0 - d1 + 17)>
237-
// CHECK-DAG: #[[MAP2:.*]] = affine_map<(d0, d1, d2) -> (d0, -d1 - d2 + 18)>
237+
// CHECK-DAG: #[[MAP2:.*]] = affine_map<(d0, d1, d2) -> (d0, -d1 - d2 + 17)>
238238
#map0 = affine_map<(d0, d1) -> (d0, d0 + d1)>
239239
#map1 = affine_map<(d0, d1) -> (d0, d1)>
240240

241241
// CHECK: fuse_non_rectangular
242-
// CHECK-SAME: %[[ARG0:[0-9a-zA-Z]*]]: tensor<10x18xf32>
243-
func @fuse_non_rectangular(%arg0: tensor<10x18xf32>,
242+
// CHECK-SAME: %[[ARG0:[0-9a-zA-Z]*]]: tensor<10x17xf32>
243+
func @fuse_non_rectangular(%arg0: tensor<10x17xf32>,
244244
%arg1: tensor<10x8xf32>) -> tensor<10x8xf32> {
245+
246+
// CHECK-DAG: %[[C0:.*]] = constant 0 : index
247+
// CHECK-DAG: %[[C4:.*]] = constant 4 : index
248+
// CHECK-DAG: %[[C5:.*]] = constant 5 : index
249+
// CHECK-DAG: %[[C8:.*]] = constant 8 : index
250+
// CHECK-DAG: %[[C10:.*]] = constant 10 : index
245251
%cst = constant 0.000000e+00 : f32
246-
%0 = linalg.fill(%cst, %arg0) : f32, tensor<10x18xf32> -> tensor<10x18xf32>
252+
%0 = linalg.fill(%cst, %arg0) : f32, tensor<10x17xf32> -> tensor<10x17xf32>
247253

248-
// CHECK: scf.for %[[IV0:[0-9a-zA-Z]*]] = %c0 to %c8 step %c4
249-
// CHECK: scf.for %[[IV1:[0-9a-zA-Z]*]] = %c0 to %c10 step %c5
254+
// CHECK: scf.for %[[IV0:[0-9a-zA-Z]*]] = %[[C0]] to %[[C8]] step %[[C4]]
255+
// CHECK: scf.for %[[IV1:[0-9a-zA-Z]*]] = %[[C0]] to %[[C10]] step %[[C5]]
250256

251257
// Compute producer on a hyper rectangular bounding box. Along the second dimenson,
252258
// 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>,
259265
// CHECK-SAME: %[[IV1]], %[[SUM]]
260266
// CHECK-SAME: , %[[UB1]]
261267
// CHECK: %[[T1:.*]] = linalg.fill(%{{.*}}, %[[T0]])
262-
%1 = linalg.generic {indexing_maps = [#map0, #map1], iterator_types = ["parallel", "parallel"]} ins(%0 : tensor<10x18xf32>) outs(%arg1 : tensor<10x8xf32>) {
268+
%1 = linalg.generic {indexing_maps = [#map0, #map1], iterator_types = ["parallel", "parallel"]} ins(%0 : tensor<10x17xf32>) outs(%arg1 : tensor<10x8xf32>) {
263269
^bb0(%arg2: f32, %arg3: f32): // no predecessors
264270
%2 = addf %arg2, %arg3 : f32
265271
linalg.yield %2 : f32

0 commit comments

Comments
 (0)