16
16
// moved to bb0, we need to insert allocs and copies.
17
17
18
18
// CHECK-LABEL: func @condBranch
19
- func @condBranch (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
19
+ func.func @condBranch (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
20
20
cf.cond_br %arg0 , ^bb1 , ^bb2
21
21
^bb1 :
22
22
cf.br ^bb3 (%arg1 : memref <2 xf32 >)
@@ -57,7 +57,7 @@ func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
57
57
// to %2 in block bb3.
58
58
59
59
// CHECK-LABEL: func @condBranchDynamicType
60
- func @condBranchDynamicType (
60
+ func.func @condBranchDynamicType (
61
61
%arg0: i1 ,
62
62
%arg1: memref <?xf32 >,
63
63
%arg2: memref <?xf32 >,
@@ -93,7 +93,7 @@ func @condBranchDynamicType(
93
93
// Test case: See above.
94
94
95
95
// CHECK-LABEL: func @condBranchUnrankedType
96
- func @condBranchUnrankedType (
96
+ func.func @condBranchUnrankedType (
97
97
%arg0: i1 ,
98
98
%arg1: memref <*xf32 >,
99
99
%arg2: memref <*xf32 >,
@@ -148,7 +148,7 @@ func @condBranchUnrankedType(
148
148
// bb6. Furthermore, there should be no copy inserted for %4.
149
149
150
150
// CHECK-LABEL: func @condBranchDynamicTypeNested
151
- func @condBranchDynamicTypeNested (
151
+ func.func @condBranchDynamicTypeNested (
152
152
%arg0: i1 ,
153
153
%arg1: memref <?xf32 >,
154
154
%arg2: memref <?xf32 >,
@@ -203,7 +203,7 @@ func @condBranchDynamicTypeNested(
203
203
// before ReturnOp.
204
204
205
205
// CHECK-LABEL: func @emptyUsesValue
206
- func @emptyUsesValue (%arg0: memref <4 xf32 >) {
206
+ func.func @emptyUsesValue (%arg0: memref <4 xf32 >) {
207
207
%0 = memref.alloc () : memref <4 xf32 >
208
208
return
209
209
}
@@ -224,7 +224,7 @@ func @emptyUsesValue(%arg0: memref<4xf32>) {
224
224
// we have to insert a copy and an alloc in the beginning of the function.
225
225
226
226
// CHECK-LABEL: func @criticalEdge
227
- func @criticalEdge (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
227
+ func.func @criticalEdge (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
228
228
cf.cond_br %arg0 , ^bb1 , ^bb2 (%arg1 : memref <2 xf32 >)
229
229
^bb1 :
230
230
%0 = memref.alloc () : memref <2 xf32 >
@@ -257,7 +257,7 @@ func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
257
257
// exit block after CopyOp since %1 is an alias for %0 and %arg1.
258
258
259
259
// CHECK-LABEL: func @invCriticalEdge
260
- func @invCriticalEdge (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
260
+ func.func @invCriticalEdge (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
261
261
%0 = memref.alloc () : memref <2 xf32 >
262
262
test.buffer_based in (%arg1: memref <2 xf32 >) out (%0: memref <2 xf32 >)
263
263
cf.cond_br %arg0 , ^bb1 , ^bb2 (%arg1 : memref <2 xf32 >)
@@ -285,7 +285,7 @@ func @invCriticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
285
285
// %7 should happen after CopyOp.
286
286
287
287
// CHECK-LABEL: func @ifElse
288
- func @ifElse (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
288
+ func.func @ifElse (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
289
289
%0 = memref.alloc () : memref <2 xf32 >
290
290
test.buffer_based in (%arg1: memref <2 xf32 >) out (%0: memref <2 xf32 >)
291
291
cf.cond_br %arg0 ,
@@ -323,7 +323,7 @@ func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
323
323
// in the exit block since %5 or %6 are the latest aliases of %0.
324
324
325
325
// CHECK-LABEL: func @ifElseNoUsers
326
- func @ifElseNoUsers (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
326
+ func.func @ifElseNoUsers (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
327
327
%0 = memref.alloc () : memref <2 xf32 >
328
328
test.buffer_based in (%arg1: memref <2 xf32 >) out (%0: memref <2 xf32 >)
329
329
cf.cond_br %arg0 ,
@@ -358,7 +358,7 @@ func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
358
358
// inserted in the exit block.
359
359
360
360
// CHECK-LABEL: func @ifElseNested
361
- func @ifElseNested (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
361
+ func.func @ifElseNested (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
362
362
%0 = memref.alloc () : memref <2 xf32 >
363
363
test.buffer_based in (%arg1: memref <2 xf32 >) out (%0: memref <2 xf32 >)
364
364
cf.cond_br %arg0 ,
@@ -395,7 +395,7 @@ func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
395
395
// DeallocOps after the last BufferBasedOp.
396
396
397
397
// CHECK-LABEL: func @redundantOperations
398
- func @redundantOperations (%arg0: memref <2 xf32 >) {
398
+ func.func @redundantOperations (%arg0: memref <2 xf32 >) {
399
399
%0 = memref.alloc () : memref <2 xf32 >
400
400
test.buffer_based in (%arg0: memref <2 xf32 >) out (%0: memref <2 xf32 >)
401
401
%1 = memref.alloc () : memref <2 xf32 >
@@ -426,7 +426,7 @@ func @redundantOperations(%arg0: memref<2xf32>) {
426
426
// block.
427
427
428
428
// CHECK-LABEL: func @moving_alloc_and_inserting_missing_dealloc
429
- func @moving_alloc_and_inserting_missing_dealloc (
429
+ func.func @moving_alloc_and_inserting_missing_dealloc (
430
430
%cond: i1 ,
431
431
%arg0: memref <2 xf32 >,
432
432
%arg1: memref <2 xf32 >) {
@@ -475,7 +475,7 @@ func @moving_alloc_and_inserting_missing_dealloc(
475
475
// moved to exit block.
476
476
477
477
// CHECK-LABEL: func @moving_invalid_dealloc_op_complex
478
- func @moving_invalid_dealloc_op_complex (
478
+ func.func @moving_invalid_dealloc_op_complex (
479
479
%cond: i1 ,
480
480
%arg0: memref <2 xf32 >,
481
481
%arg1: memref <2 xf32 >) {
@@ -503,7 +503,7 @@ func @moving_invalid_dealloc_op_complex(
503
503
// Test Case: Inserting missing DeallocOp in a single block.
504
504
505
505
// CHECK-LABEL: func @inserting_missing_dealloc_simple
506
- func @inserting_missing_dealloc_simple (
506
+ func.func @inserting_missing_dealloc_simple (
507
507
%arg0 : memref <2 xf32 >,
508
508
%arg1: memref <2 xf32 >) {
509
509
%0 = memref.alloc () : memref <2 xf32 >
@@ -522,7 +522,7 @@ func @inserting_missing_dealloc_simple(
522
522
// single block.
523
523
524
524
// CHECK-LABEL: func @moving_invalid_dealloc_op
525
- func @moving_invalid_dealloc_op (%arg0 : memref <2 xf32 >, %arg1: memref <2 xf32 >) {
525
+ func.func @moving_invalid_dealloc_op (%arg0 : memref <2 xf32 >, %arg1: memref <2 xf32 >) {
526
526
%0 = memref.alloc () : memref <2 xf32 >
527
527
test.buffer_based in (%arg0: memref <2 xf32 >) out (%0: memref <2 xf32 >)
528
528
memref.dealloc %0 : memref <2 xf32 >
@@ -544,7 +544,7 @@ func @moving_invalid_dealloc_op(%arg0 : memref<2xf32>, %arg1: memref<2xf32>) {
544
544
// inserted after CopyOp.
545
545
546
546
// CHECK-LABEL: func @nested_regions_and_cond_branch
547
- func @nested_regions_and_cond_branch (
547
+ func.func @nested_regions_and_cond_branch (
548
548
%arg0: i1 ,
549
549
%arg1: memref <2 xf32 >,
550
550
%arg2: memref <2 xf32 >) {
@@ -589,7 +589,7 @@ func @nested_regions_and_cond_branch(
589
589
// deallocating. It should dealloc %y after CopyOp.
590
590
591
591
// CHECK-LABEL: func @memref_in_function_results
592
- func @memref_in_function_results (
592
+ func.func @memref_in_function_results (
593
593
%arg0: memref <5 xf32 >,
594
594
%arg1: memref <10 xf32 >,
595
595
%arg2: memref <5 xf32 >) -> (memref <10 xf32 >, memref <15 xf32 >) {
@@ -615,7 +615,7 @@ func @memref_in_function_results(
615
615
// requires a dealloc.
616
616
617
617
// CHECK-LABEL: func @nested_region_control_flow
618
- func @nested_region_control_flow (
618
+ func.func @nested_region_control_flow (
619
619
%arg0 : index ,
620
620
%arg1 : index ) -> memref <?x?xf32 > {
621
621
%0 = arith.cmpi eq , %arg0 , %arg1 : index
@@ -645,7 +645,7 @@ func @nested_region_control_flow(
645
645
// returned in the end.
646
646
647
647
// CHECK-LABEL: func @nested_region_control_flow_div
648
- func @nested_region_control_flow_div (
648
+ func.func @nested_region_control_flow_div (
649
649
%arg0 : index ,
650
650
%arg1 : index ) -> memref <?x?xf32 > {
651
651
%0 = arith.cmpi eq , %arg0 , %arg1 : index
@@ -677,7 +677,7 @@ func @nested_region_control_flow_div(
677
677
// the method.
678
678
679
679
// CHECK-LABEL: func @inner_region_control_flow
680
- func @inner_region_control_flow (%arg0 : index ) -> memref <?x?xf32 > {
680
+ func.func @inner_region_control_flow (%arg0 : index ) -> memref <?x?xf32 > {
681
681
%0 = memref.alloc (%arg0 , %arg0 ) : memref <?x?xf32 >
682
682
%1 = test.region_if %0 : memref <?x?xf32 > -> (memref <?x?xf32 >) then {
683
683
^bb0 (%arg1 : memref <?x?xf32 >):
@@ -705,7 +705,7 @@ func @inner_region_control_flow(%arg0 : index) -> memref<?x?xf32> {
705
705
// -----
706
706
707
707
// CHECK-LABEL: func @subview
708
- func @subview (%arg0 : index , %arg1 : index , %arg2 : memref <?x?xf32 >) {
708
+ func.func @subview (%arg0 : index , %arg1 : index , %arg2 : memref <?x?xf32 >) {
709
709
%0 = memref.alloc () : memref <64 x4 xf32 , offset : 0 , strides : [4 , 1 ]>
710
710
%1 = memref.subview %0 [%arg0 , %arg1 ][%arg0 , %arg1 ][%arg0 , %arg1 ] :
711
711
memref <64 x4 xf32 , offset : 0 , strides : [4 , 1 ]>
@@ -727,7 +727,7 @@ func @subview(%arg0 : index, %arg1 : index, %arg2 : memref<?x?xf32>) {
727
727
// Therefore, all allocas are not handled.
728
728
729
729
// CHECK-LABEL: func @condBranchAlloca
730
- func @condBranchAlloca (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
730
+ func.func @condBranchAlloca (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
731
731
cf.cond_br %arg0 , ^bb1 , ^bb2
732
732
^bb1 :
733
733
cf.br ^bb3 (%arg1 : memref <2 xf32 >)
@@ -754,7 +754,7 @@ func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
754
754
// dealloc.
755
755
756
756
// CHECK-LABEL: func @ifElseAlloca
757
- func @ifElseAlloca (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
757
+ func.func @ifElseAlloca (%arg0: i1 , %arg1: memref <2 xf32 >, %arg2: memref <2 xf32 >) {
758
758
%0 = memref.alloc () : memref <2 xf32 >
759
759
test.buffer_based in (%arg1: memref <2 xf32 >) out (%0: memref <2 xf32 >)
760
760
cf.cond_br %arg0 ,
@@ -782,7 +782,7 @@ func @ifElseAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
782
782
// -----
783
783
784
784
// CHECK-LABEL: func @ifElseNestedAlloca
785
- func @ifElseNestedAlloca (
785
+ func.func @ifElseNestedAlloca (
786
786
%arg0: i1 ,
787
787
%arg1: memref <2 xf32 >,
788
788
%arg2: memref <2 xf32 >) {
@@ -817,7 +817,7 @@ func @ifElseNestedAlloca(
817
817
// -----
818
818
819
819
// CHECK-LABEL: func @nestedRegionsAndCondBranchAlloca
820
- func @nestedRegionsAndCondBranchAlloca (
820
+ func.func @nestedRegionsAndCondBranchAlloca (
821
821
%arg0: i1 ,
822
822
%arg1: memref <2 xf32 >,
823
823
%arg2: memref <2 xf32 >) {
@@ -857,7 +857,7 @@ func @nestedRegionsAndCondBranchAlloca(
857
857
// -----
858
858
859
859
// CHECK-LABEL: func @nestedRegionControlFlowAlloca
860
- func @nestedRegionControlFlowAlloca (
860
+ func.func @nestedRegionControlFlowAlloca (
861
861
%arg0 : index ,
862
862
%arg1 : index ) -> memref <?x?xf32 > {
863
863
%0 = arith.cmpi eq , %arg0 , %arg1 : index
@@ -885,7 +885,7 @@ func @nestedRegionControlFlowAlloca(
885
885
// memory leaks.
886
886
887
887
// CHECK-LABEL: func @loop_alloc
888
- func @loop_alloc (
888
+ func.func @loop_alloc (
889
889
%lb: index ,
890
890
%ub: index ,
891
891
%step: index ,
@@ -926,7 +926,7 @@ func @loop_alloc(
926
926
// that are passed via the backedges.
927
927
928
928
// CHECK-LABEL: func @loop_nested_if_no_alloc
929
- func @loop_nested_if_no_alloc (
929
+ func.func @loop_nested_if_no_alloc (
930
930
%lb: index ,
931
931
%ub: index ,
932
932
%step: index ,
@@ -967,7 +967,7 @@ func @loop_nested_if_no_alloc(
967
967
// "returning" %3.
968
968
969
969
// CHECK-LABEL: func @loop_nested_if_alloc
970
- func @loop_nested_if_alloc (
970
+ func.func @loop_nested_if_alloc (
971
971
%lb: index ,
972
972
%ub: index ,
973
973
%step: index ,
@@ -1017,7 +1017,7 @@ func @loop_nested_if_alloc(
1017
1017
// before each yield in all loops recursively.
1018
1018
1019
1019
// CHECK-LABEL: func @loop_nested_alloc
1020
- func @loop_nested_alloc (
1020
+ func.func @loop_nested_alloc (
1021
1021
%lb: index ,
1022
1022
%ub: index ,
1023
1023
%step: index ,
@@ -1093,7 +1093,7 @@ func @loop_nested_alloc(
1093
1093
// -----
1094
1094
1095
1095
// CHECK-LABEL: func @affine_loop
1096
- func @affine_loop () {
1096
+ func.func @affine_loop () {
1097
1097
%buffer = memref.alloc () : memref <1024 xf32 >
1098
1098
%sum_init_0 = arith.constant 0.0 : f32
1099
1099
%res = affine.for %i = 0 to 10 step 2 iter_args (%sum_iter = %sum_init_0 ) -> f32 {
@@ -1115,7 +1115,7 @@ func @affine_loop() {
1115
1115
// control-flow loop since they are not supported.
1116
1116
1117
1117
// expected-error@+1 {{Only structured control-flow loops are supported}}
1118
- func @loop_dynalloc (
1118
+ func.func @loop_dynalloc (
1119
1119
%arg0 : i32 ,
1120
1120
%arg1 : i32 ,
1121
1121
%arg2: memref <?xf32 >,
@@ -1148,7 +1148,7 @@ func @loop_dynalloc(
1148
1148
// control-flow loop since they are not supported.
1149
1149
1150
1150
// expected-error@+1 {{Only structured control-flow loops are supported}}
1151
- func @do_loop_alloc (
1151
+ func.func @do_loop_alloc (
1152
1152
%arg0 : i32 ,
1153
1153
%arg1 : i32 ,
1154
1154
%arg2: memref <2 xf32 >,
@@ -1176,7 +1176,7 @@ func @do_loop_alloc(
1176
1176
// -----
1177
1177
1178
1178
// CHECK-LABEL: func @assumingOp(
1179
- func @assumingOp (
1179
+ func.func @assumingOp (
1180
1180
%arg0: !shape.witness ,
1181
1181
%arg2: memref <2 xf32 >,
1182
1182
%arg3: memref <2 xf32 >) {
@@ -1214,7 +1214,7 @@ func @assumingOp(
1214
1214
// Test Case: The op "test.bar" does not implement the RegionBranchOpInterface.
1215
1215
// This is not allowed in buffer deallocation.
1216
1216
1217
- func @noRegionBranchOpInterface () {
1217
+ func.func @noRegionBranchOpInterface () {
1218
1218
// expected-error@+1 {{All operations with attached regions need to implement the RegionBranchOpInterface.}}
1219
1219
%0 = " test.bar" () ({
1220
1220
// expected-error@+1 {{All operations with attached regions need to implement the RegionBranchOpInterface.}}
@@ -1235,7 +1235,7 @@ func @noRegionBranchOpInterface() {
1235
1235
// CHECK-NOT: memref.dealloc %[[RES0]]
1236
1236
// CHECK: memref.dealloc %[[RES1]]
1237
1237
// CHECK: return %[[RES0]]
1238
- func @dealloc_existing_clones (%arg0: memref <?x?xf64 >, %arg1: memref <?x?xf64 >) -> memref <?x?xf64 > {
1238
+ func.func @dealloc_existing_clones (%arg0: memref <?x?xf64 >, %arg1: memref <?x?xf64 >) -> memref <?x?xf64 > {
1239
1239
%0 = bufferization.clone %arg0 : memref <?x?xf64 > to memref <?x?xf64 >
1240
1240
%1 = bufferization.clone %arg1 : memref <?x?xf64 > to memref <?x?xf64 >
1241
1241
return %0 : memref <?x?xf64 >
@@ -1244,7 +1244,7 @@ func @dealloc_existing_clones(%arg0: memref<?x?xf64>, %arg1: memref<?x?xf64>) ->
1244
1244
// -----
1245
1245
1246
1246
// CHECK-LABEL: func @while_two_arg
1247
- func @while_two_arg (%arg0: index ) {
1247
+ func.func @while_two_arg (%arg0: index ) {
1248
1248
%a = memref.alloc (%arg0 ) : memref <?xf32 >
1249
1249
// CHECK: %[[WHILE:.*]]:2 = scf.while (%[[ARG1:.*]] = %[[ALLOC:.*]], %[[ARG2:.*]] = %[[CLONE:.*]])
1250
1250
scf.while (%arg1 = %a , %arg2 = %a ) : (memref <?xf32 >, memref <?xf32 >) -> (memref <?xf32 >, memref <?xf32 >) {
@@ -1271,7 +1271,7 @@ func @while_two_arg(%arg0: index) {
1271
1271
1272
1272
// -----
1273
1273
1274
- func @while_three_arg (%arg0: index ) {
1274
+ func.func @while_three_arg (%arg0: index ) {
1275
1275
// CHECK: %[[ALLOC:.*]] = memref.alloc
1276
1276
%a = memref.alloc (%arg0 ) : memref <?xf32 >
1277
1277
// CHECK-NEXT: %[[CLONE1:.*]] = bufferization.clone %[[ALLOC]]
0 commit comments