@@ -80,8 +80,8 @@ func.func @fully_connected(%arg0: tensor<5x3xf32>, %arg1: tensor<6x3xf32>, %arg2
80
80
// CHECK: [[INITB:%.+]] = tensor.empty()
81
81
// CHECK: [[MATMUL:%.+]] = linalg.matmul ins(%arg0, [[TRANSPOSE]] : tensor<5x3xf32>, tensor<3x6xf32>) outs([[FILL]] : tensor<5x6xf32>) -> tensor<5x6xf32>
82
82
// CHECK: [[ADDED:%.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP2]], #[[$MAP2]]], iterator_types = ["parallel", "parallel"]} ins(%arg2, [[MATMUL]] : tensor<6xf32>, tensor<5x6xf32>) outs([[INITB]] : tensor<5x6xf32>) {
83
- // CHECK: ^bb0(%arg3: f32, %arg4: f32, %arg5 : f32):
84
- // CHECK: [[ADD:%.+]] = arith.addf %arg3 , %arg4 : f32
83
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: f32, %[[ARG4:[0-9a-zA-Z_]+]]: f32, %[[ARG5:[0-9a-zA-Z_]+]] : f32):
84
+ // CHECK: [[ADD:%.+]] = arith.addf %[[ARG3]] , %[[ARG4]] : f32
85
85
// CHECK: linalg.yield [[ADD]] : f32
86
86
87
87
%0 = " tosa.fully_connected" (%arg0 , %arg1 , %arg2 ) : (tensor <5 x3 xf32 >, tensor <6 x3 xf32 >, tensor <6 xf32 >) -> (tensor <5 x6 xf32 >)
@@ -129,8 +129,8 @@ func.func @fully_connected_dyn(%arg0: tensor<?x3xf32>, %arg1: tensor<6x3xf32>, %
129
129
// CHECK: %[[INITB:.+]] = tensor.empty(%[[DIM]])
130
130
// CHECK: %[[MATMUL:.+]] = linalg.matmul ins(%arg0, %[[TRANSPOSE]] : tensor<?x3xf32>, tensor<3x6xf32>) outs(%[[FILL]] : tensor<?x6xf32>) -> tensor<?x6xf32>
131
131
// CHECK: %[[ADDED:.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP2]], #[[$MAP2]]], iterator_types = ["parallel", "parallel"]} ins(%arg2, %[[MATMUL]] : tensor<6xf32>, tensor<?x6xf32>) outs(%[[INITB]] : tensor<?x6xf32>) {
132
- // CHECK: ^bb0(%arg3: f32, %arg4: f32, %arg5 : f32):
133
- // CHECK: %[[ADD:.+]] = arith.addf %arg3 , %arg4 : f32
132
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: f32, %[[ARG4:[0-9a-zA-Z_]+]]: f32, %[[ARG5:[0-9a-zA-Z_]+]] : f32):
133
+ // CHECK: %[[ADD:.+]] = arith.addf %[[ARG3]] , %[[ARG4]] : f32
134
134
// CHECK: linalg.yield %[[ADD]] : f32
135
135
136
136
%0 = " tosa.fully_connected" (%arg0 , %arg1 , %arg2 ) : (tensor <?x3 xf32 >, tensor <6 x3 xf32 >, tensor <6 xf32 >) -> (tensor <?x6 xf32 >)
@@ -214,6 +214,7 @@ func.func @avg_pool(%arg0: tensor<1x6x34x62xf32>) -> (tensor<1x5x33x62xf32>) {
214
214
// CHECK: [[POOL:%.+]] = linalg.pooling_nhwc_sum {dilations = dense<1> : vector<2xi64>, strides = dense<1> : vector<2xi64>} ins([[PAD]], [[KERNEL]] : tensor<1x8x36x62xf32>, tensor<4x4xf32>) outs([[FILL]] : tensor<1x5x33x62xf32>)
215
215
// CHECK: [[INIT:%.+]] = tensor.empty()
216
216
// CHECK: [[GENERIC:%.+]] = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins([[POOL]] : tensor<1x5x33x62xf32>) outs([[INIT]] : tensor<1x5x33x62xf32>)
217
+ // CHECK: ^bb0(%[[BBARG1:[a-zA-Z0-9_]+]]: f32,
217
218
// CHECK: [[ZERO:%.0]] = arith.constant 0
218
219
// CHECK: [[ONE:%.+]] = arith.constant 1
219
220
// CHECK: [[HEIGHT:%.+]] = arith.constant 4
@@ -255,7 +256,7 @@ func.func @avg_pool(%arg0: tensor<1x6x34x62xf32>) -> (tensor<1x5x33x62xf32>) {
255
256
// CHECK: [[C:%.+]] = arith.muli [[YSEL]], [[XSEL]]
256
257
// CHECK: [[CI:%.+]] = arith.index_cast [[C]]
257
258
// CHECK: [[CF:%.+]] = arith.sitofp [[CI]]
258
- // CHECK: [[RESULT:%.+]] = arith.divf %arg1 , [[CF]]
259
+ // CHECK: [[RESULT:%.+]] = arith.divf %[[BBARG1]] , [[CF]]
259
260
// CHECK: linalg.yield [[RESULT]]
260
261
%0 = " tosa.avg_pool2d" (%arg0 ) {pad = [1 , 1 , 1 , 1 ], kernel = [4 , 4 ], stride = [1 , 1 ]} : (tensor <1 x6 x34 x62 xf32 >) -> (tensor <1 x5 x33 x62 xf32 >)
261
262
return %0 : tensor <1 x5 x33 x62 xf32 >
@@ -286,10 +287,11 @@ func.func @avg_pool_i8(%arg0 : tensor<1x128x128x2xi8>) -> () {
286
287
287
288
// CHECK: linalg.pooling_nhwc_sum
288
289
// CHECK: linalg.generic
290
+ // CHECK: ^bb0(%[[BBARG1:[a-zA-Z0-9_]+]]: i32,
289
291
290
292
// CHECK: %[[INZP:.+]] = arith.constant -128
291
293
// CHECK: %[[INZP_OFF:.+]] = arith.muli %{{.+}}, %[[INZP]]
292
- // CHECK: %[[OFFSETED:.+]] = arith.subi %arg1 , %[[INZP_OFF]]
294
+ // CHECK: %[[OFFSETED:.+]] = arith.subi %[[BBARG1]] , %[[INZP_OFF]]
293
295
// CHECK: %[[NUMERATOR:.+]] = arith.constant 1073741825
294
296
// CHECK: %[[MULTIPLIER:.+]] = arith.divui %[[NUMERATOR]], %{{.+}}
295
297
// CHECK: %[[SHIFT:.+]] = arith.constant 30
@@ -315,10 +317,11 @@ func.func @avg_pool_i16(%arg0 : tensor<1x128x128x2xi16>) -> () {
315
317
316
318
// CHECK: linalg.pooling_nhwc_sum
317
319
// CHECK: linalg.generic
320
+ // CHECK: ^bb0(%[[BBARG1:[a-zA-Z0-9_]+]]: i32,
318
321
319
322
// CHECK: %[[INZP:.+]] = arith.constant -128
320
323
// CHECK: %[[INZP_OFF:.+]] = arith.muli %{{.+}}, %[[INZP]]
321
- // CHECK: %[[OFFSETED:.+]] = arith.subi %arg1 , %[[INZP_OFF]]
324
+ // CHECK: %[[OFFSETED:.+]] = arith.subi %[[BBARG1]] , %[[INZP_OFF]]
322
325
// CHECK: %[[NUMERATOR:.+]] = arith.constant 1073741825
323
326
// CHECK: %[[MULTIPLIER:.+]] = arith.divui %[[NUMERATOR]], %{{.+}}
324
327
// CHECK: %[[SHIFT:.+]] = arith.constant 30
@@ -479,8 +482,8 @@ func.func @depthwise_conv(%arg0 : tensor<1x7x5x3xf32>, %arg1 : tensor<3x1x3x11xf
479
482
// CHECK: [[DEPTH:%.+]] = linalg.depthwise_conv_2d_nhwc_hwcm {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<1x7x5x3xf32>, tensor<3x1x3x11xf32>) outs([[FILL]] : tensor<1x5x5x3x11xf32>)
480
483
// CHECK: [[COLLAPSED:%.+]] = tensor.collapse_shape [[DEPTH]] {{\[}}[0], [1], [2], [3, 4]]
481
484
// CHECK: [[BIAS:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, [[COLLAPSED]] : tensor<33xf32>, tensor<1x5x5x33xf32>) outs([[OUT]] : tensor<1x5x5x33xf32>) {
482
- // CHECK: ^bb0(%arg3: f32, %arg4: f32, %arg5 : f32):
483
- // CHECK: [[ADD:%.+]] = arith.addf %arg3 , %arg4 : f32
485
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: f32, %[[ARG4:[0-9a-zA-Z_]+]]: f32, %[[ARG5:[0-9a-zA-Z_]+]] : f32):
486
+ // CHECK: [[ADD:%.+]] = arith.addf %[[ARG3]] , %[[ARG4]] : f32
484
487
// CHECK: linalg.yield [[ADD]] : f32
485
488
// CHECK: } -> tensor<1x5x5x33xf32>
486
489
%2 = " tosa.depthwise_conv2d" (%arg0 , %arg1 , %arg2 ) { pad = [0 , 0 , 0 , 0 ], stride = [1 , 1 ], dilation = [1 , 1 ] } : (tensor <1 x7 x5 x3 xf32 >, tensor <3 x1 x3 x11 xf32 >, tensor <33 xf32 >) -> (tensor <1 x5 x5 x33 xf32 >)
@@ -503,8 +506,8 @@ func.func @depthwise_conv_dyn(%arg0 : tensor<?x7x5x3xf32>, %arg1 : tensor<3x1x3x
503
506
// CHECK: %[[DEPTH:.+]] = linalg.depthwise_conv_2d_nhwc_hwcm {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<?x7x5x3xf32>, tensor<3x1x3x11xf32>) outs(%[[FILL]] : tensor<?x5x5x3x11xf32>)
504
507
// CHECK: %[[COLLAPSED:.+]] = tensor.collapse_shape %[[DEPTH]] {{\[}}[0], [1], [2], [3, 4]]
505
508
// CHECK: %[[BIAS:.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, %[[COLLAPSED]] : tensor<33xf32>, tensor<?x5x5x33xf32>) outs(%[[OUT]] : tensor<?x5x5x33xf32>) {
506
- // CHECK: ^bb0(%arg3: f32, %arg4: f32, %arg5 : f32):
507
- // CHECK: %[[ADD:.+]] = arith.addf %arg3 , %arg4 : f32
509
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: f32, %[[ARG4:[0-9a-zA-Z_]+]]: f32, %[[ARG5:[0-9a-zA-Z_]+]] : f32):
510
+ // CHECK: %[[ADD:.+]] = arith.addf %[[ARG3]] , %[[ARG4]] : f32
508
511
// CHECK: linalg.yield %[[ADD]] : f32
509
512
// CHECK: } -> tensor<?x5x5x33xf32>
510
513
%2 = " tosa.depthwise_conv2d" (%arg0 , %arg1 , %arg2 ) { pad = [0 , 0 , 0 , 0 ], stride = [1 , 1 ], dilation = [1 , 1 ] } : (tensor <?x7 x5 x3 xf32 >, tensor <3 x1 x3 x11 xf32 >, tensor <33 xf32 >) -> (tensor <?x5 x5 x33 xf32 >)
@@ -525,8 +528,8 @@ func.func @depthwise_conv_strides(%arg0 : tensor<1x11x9x3xf32>, %arg1 : tensor<3
525
528
// CHECK: [[DEPTH:%.+]] = linalg.depthwise_conv_2d_nhwc_hwcm {dilations = dense<1> : tensor<2xi64>, strides = dense<2> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<1x11x9x3xf32>, tensor<3x1x3x11xf32>) outs([[FILL]] : tensor<1x5x5x3x11xf32>)
526
529
// CHECK: [[COLLAPSED:%.+]] = tensor.collapse_shape [[DEPTH]] {{\[}}[0], [1], [2], [3, 4]]
527
530
// CHECK: [[BIAS:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, [[COLLAPSED]] : tensor<33xf32>, tensor<1x5x5x33xf32>) outs([[OUT]] : tensor<1x5x5x33xf32>) {
528
- // CHECK: ^bb0(%arg3: f32, %arg4: f32, %arg5 : f32):
529
- // CHECK: [[ADD:%.+]] = arith.addf %arg3 , %arg4 : f32
531
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: f32, %[[ARG4:[0-9a-zA-Z_]+]]: f32, %[[ARG5:[0-9a-zA-Z_]+]] : f32):
532
+ // CHECK: [[ADD:%.+]] = arith.addf %[[ARG3]] , %[[ARG4]] : f32
530
533
// CHECK: linalg.yield [[ADD]] : f32
531
534
// CHECK: } -> tensor<1x5x5x33xf32>
532
535
%2 = " tosa.depthwise_conv2d" (%arg0 , %arg1 , %arg2 ) { pad = [0 , 0 , 0 , 0 ], stride = [2 , 2 ], dilation = [1 , 1 ] } : (tensor <1 x11 x9 x3 xf32 >, tensor <3 x1 x3 x11 xf32 >, tensor <33 xf32 >) -> (tensor <1 x5 x5 x33 xf32 >)
@@ -553,8 +556,8 @@ func.func @depthwise_conv_quant(%arg0 : tensor<1x12x12x4xi8>, %arg1 : tensor<3x3
553
556
// CHECK: [[DEPTH:%.+]] = linalg.depthwise_conv_2d_nhwc_hwcm_q {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins([[PAD]], %arg1, [[C128]], [[C42]] : tensor<1x14x14x4xi8>, tensor<3x3x4x128xi8>, i32, i32) outs([[FILL]] : tensor<1x12x12x4x128xi32>)
554
557
// CHECK: [[COLLAPSED:%.+]] = tensor.collapse_shape [[DEPTH]] {{\[}}[0], [1], [2], [3, 4]]
555
558
// CHECK: [[BIAS:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, [[COLLAPSED]] : tensor<512xi32>, tensor<1x12x12x512xi32>) outs([[OUT]] : tensor<1x12x12x512xi32>) {
556
- // CHECK: ^bb0(%arg3: i32, %arg4: i32, %arg5 : i32):
557
- // CHECK: [[ADD:%.+]] = arith.addi %arg3 , %arg4 : i32
559
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: i32, %[[ARG4:[0-9a-zA-Z_]+]]: i32, %[[ARG5:[0-9a-zA-Z_]+]] : i32):
560
+ // CHECK: [[ADD:%.+]] = arith.addi %[[ARG3]] , %[[ARG4]] : i32
558
561
// CHECK: linalg.yield [[ADD]] : i32
559
562
// CHECK: } -> tensor<1x12x12x512xi32>
560
563
%0 = " tosa.depthwise_conv2d" (%arg0 , %arg1 , %arg2 ) {pad = [1 , 1 , 1 , 1 ], quantization_info = #tosa.conv_quant <input_zp = -128 , weight_zp = 42 >, stride = [1 , 1 ], dilation = [1 , 1 ] } : (tensor <1 x12 x12 x4 xi8 >, tensor <3 x3 x4 x128 xi8 >, tensor <512 xi32 >) -> tensor <1 x12 x12 x512 xi32 >
@@ -577,8 +580,8 @@ func.func @depthwise_conv_quant_dilations(%arg0 : tensor<1x14x14x4xi8>, %arg1 :
577
580
// CHECK: [[DEPTH:%.+]] = linalg.depthwise_conv_2d_nhwc_hwcm_q {dilations = dense<2> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1, [[C128]], [[C42]] : tensor<1x14x14x4xi8>, tensor<3x3x4x128xi8>, i32, i32) outs([[FILL]] : tensor<1x10x10x4x128xi32>)
578
581
// CHECK: [[COLLAPSED:%.+]] = tensor.collapse_shape [[DEPTH]] {{\[}}[0], [1], [2], [3, 4]]
579
582
// CHECK: [[BIAS:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, [[COLLAPSED]] : tensor<512xi32>, tensor<1x10x10x512xi32>) outs([[OUT]] : tensor<1x10x10x512xi32>) {
580
- // CHECK: ^bb0(%arg3: i32, %arg4: i32, %arg5 : i32):
581
- // CHECK: [[ADD:%.+]] = arith.addi %arg3 , %arg4 : i32
583
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: i32, %[[ARG4:[0-9a-zA-Z_]+]]: i32, %[[ARG5:[0-9a-zA-Z_]+]] : i32):
584
+ // CHECK: [[ADD:%.+]] = arith.addi %[[ARG3]] , %[[ARG4]] : i32
582
585
// CHECK: linalg.yield [[ADD]] : i32
583
586
// CHECK: } -> tensor<1x10x10x512xi32>
584
587
%0 = " tosa.depthwise_conv2d" (%arg0 , %arg1 , %arg2 ) {pad = [0 , 0 , 0 , 0 ], quantization_info = #tosa.conv_quant <input_zp = -128 , weight_zp = 42 >, stride = [1 , 1 ], dilation = [2 , 2 ] } : (tensor <1 x14 x14 x4 xi8 >, tensor <3 x3 x4 x128 xi8 >, tensor <512 xi32 >) -> tensor <1 x10 x10 x512 xi32 >
@@ -592,7 +595,7 @@ func.func @depthwise_conv2d_dyn_w_h(%arg0: tensor<2x?x?x3xf32>, %arg1: tensor<3x
592
595
// CHECK: arith.muli
593
596
// CHECK: arith.divui
594
597
// CHECK: %[[PADDED:.+]] = tensor.pad %arg0 low[0, 1, 3, 0] high[0, 2, 4, 0] {
595
- // CHECK: ^bb0(%arg3: index, %arg4: index, %arg5: index, %arg6 : index):
598
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: index, %[[ARG4:[0-9a-zA-Z_]+]]: index, %[[ARG5:[0-9a-zA-Z_]+]]: index, %[[ARG6:[0-9a-zA-Z_]+]] : index):
596
599
// CHECK: tensor.yield %cst : f32
597
600
// CHECK: } : tensor<2x?x?x3xf32> to tensor<2x?x?x3xf32>
598
601
// CHECK: %[[CONV:.+]] = linalg.depthwise_conv_2d_nhwc_hwcm {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<[1, 2]> : tensor<2xi64>} ins(%[[PADDED]], %arg1 : tensor<2x?x?x3xf32>, tensor<3x6x3x5xf32>) outs(%{{.*}} : tensor<2x?x?x3x5xf32>) -> tensor<2x?x?x3x5xf32>
0 commit comments