Skip to content

Commit 412b885

Browse files
committed
[mlir][NFC] Update textual references of func to func.func in Bufferization/Complex/EmitC/CF/Func/GPU tests
The special case parsing of `func` operations is being removed.
1 parent 5e7dea2 commit 412b885

32 files changed

+255
-255
lines changed

mlir/test/Dialect/Bufferization/Transforms/buffer-deallocation.mlir

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// moved to bb0, we need to insert allocs and copies.
1717

1818
// CHECK-LABEL: func @condBranch
19-
func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
19+
func.func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
2020
cf.cond_br %arg0, ^bb1, ^bb2
2121
^bb1:
2222
cf.br ^bb3(%arg1 : memref<2xf32>)
@@ -57,7 +57,7 @@ func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
5757
// to %2 in block bb3.
5858

5959
// CHECK-LABEL: func @condBranchDynamicType
60-
func @condBranchDynamicType(
60+
func.func @condBranchDynamicType(
6161
%arg0: i1,
6262
%arg1: memref<?xf32>,
6363
%arg2: memref<?xf32>,
@@ -93,7 +93,7 @@ func @condBranchDynamicType(
9393
// Test case: See above.
9494

9595
// CHECK-LABEL: func @condBranchUnrankedType
96-
func @condBranchUnrankedType(
96+
func.func @condBranchUnrankedType(
9797
%arg0: i1,
9898
%arg1: memref<*xf32>,
9999
%arg2: memref<*xf32>,
@@ -148,7 +148,7 @@ func @condBranchUnrankedType(
148148
// bb6. Furthermore, there should be no copy inserted for %4.
149149

150150
// CHECK-LABEL: func @condBranchDynamicTypeNested
151-
func @condBranchDynamicTypeNested(
151+
func.func @condBranchDynamicTypeNested(
152152
%arg0: i1,
153153
%arg1: memref<?xf32>,
154154
%arg2: memref<?xf32>,
@@ -203,7 +203,7 @@ func @condBranchDynamicTypeNested(
203203
// before ReturnOp.
204204

205205
// CHECK-LABEL: func @emptyUsesValue
206-
func @emptyUsesValue(%arg0: memref<4xf32>) {
206+
func.func @emptyUsesValue(%arg0: memref<4xf32>) {
207207
%0 = memref.alloc() : memref<4xf32>
208208
return
209209
}
@@ -224,7 +224,7 @@ func @emptyUsesValue(%arg0: memref<4xf32>) {
224224
// we have to insert a copy and an alloc in the beginning of the function.
225225

226226
// CHECK-LABEL: func @criticalEdge
227-
func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
227+
func.func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
228228
cf.cond_br %arg0, ^bb1, ^bb2(%arg1 : memref<2xf32>)
229229
^bb1:
230230
%0 = memref.alloc() : memref<2xf32>
@@ -257,7 +257,7 @@ func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
257257
// exit block after CopyOp since %1 is an alias for %0 and %arg1.
258258

259259
// CHECK-LABEL: func @invCriticalEdge
260-
func @invCriticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
260+
func.func @invCriticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
261261
%0 = memref.alloc() : memref<2xf32>
262262
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
263263
cf.cond_br %arg0, ^bb1, ^bb2(%arg1 : memref<2xf32>)
@@ -285,7 +285,7 @@ func @invCriticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
285285
// %7 should happen after CopyOp.
286286

287287
// CHECK-LABEL: func @ifElse
288-
func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
288+
func.func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
289289
%0 = memref.alloc() : memref<2xf32>
290290
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
291291
cf.cond_br %arg0,
@@ -323,7 +323,7 @@ func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
323323
// in the exit block since %5 or %6 are the latest aliases of %0.
324324

325325
// CHECK-LABEL: func @ifElseNoUsers
326-
func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
326+
func.func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
327327
%0 = memref.alloc() : memref<2xf32>
328328
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
329329
cf.cond_br %arg0,
@@ -358,7 +358,7 @@ func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
358358
// inserted in the exit block.
359359

360360
// CHECK-LABEL: func @ifElseNested
361-
func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
361+
func.func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
362362
%0 = memref.alloc() : memref<2xf32>
363363
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
364364
cf.cond_br %arg0,
@@ -395,7 +395,7 @@ func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
395395
// DeallocOps after the last BufferBasedOp.
396396

397397
// CHECK-LABEL: func @redundantOperations
398-
func @redundantOperations(%arg0: memref<2xf32>) {
398+
func.func @redundantOperations(%arg0: memref<2xf32>) {
399399
%0 = memref.alloc() : memref<2xf32>
400400
test.buffer_based in(%arg0: memref<2xf32>) out(%0: memref<2xf32>)
401401
%1 = memref.alloc() : memref<2xf32>
@@ -426,7 +426,7 @@ func @redundantOperations(%arg0: memref<2xf32>) {
426426
// block.
427427

428428
// 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(
430430
%cond: i1,
431431
%arg0: memref<2xf32>,
432432
%arg1: memref<2xf32>) {
@@ -475,7 +475,7 @@ func @moving_alloc_and_inserting_missing_dealloc(
475475
// moved to exit block.
476476

477477
// CHECK-LABEL: func @moving_invalid_dealloc_op_complex
478-
func @moving_invalid_dealloc_op_complex(
478+
func.func @moving_invalid_dealloc_op_complex(
479479
%cond: i1,
480480
%arg0: memref<2xf32>,
481481
%arg1: memref<2xf32>) {
@@ -503,7 +503,7 @@ func @moving_invalid_dealloc_op_complex(
503503
// Test Case: Inserting missing DeallocOp in a single block.
504504

505505
// CHECK-LABEL: func @inserting_missing_dealloc_simple
506-
func @inserting_missing_dealloc_simple(
506+
func.func @inserting_missing_dealloc_simple(
507507
%arg0 : memref<2xf32>,
508508
%arg1: memref<2xf32>) {
509509
%0 = memref.alloc() : memref<2xf32>
@@ -522,7 +522,7 @@ func @inserting_missing_dealloc_simple(
522522
// single block.
523523

524524
// CHECK-LABEL: func @moving_invalid_dealloc_op
525-
func @moving_invalid_dealloc_op(%arg0 : memref<2xf32>, %arg1: memref<2xf32>) {
525+
func.func @moving_invalid_dealloc_op(%arg0 : memref<2xf32>, %arg1: memref<2xf32>) {
526526
%0 = memref.alloc() : memref<2xf32>
527527
test.buffer_based in(%arg0: memref<2xf32>) out(%0: memref<2xf32>)
528528
memref.dealloc %0 : memref<2xf32>
@@ -544,7 +544,7 @@ func @moving_invalid_dealloc_op(%arg0 : memref<2xf32>, %arg1: memref<2xf32>) {
544544
// inserted after CopyOp.
545545

546546
// CHECK-LABEL: func @nested_regions_and_cond_branch
547-
func @nested_regions_and_cond_branch(
547+
func.func @nested_regions_and_cond_branch(
548548
%arg0: i1,
549549
%arg1: memref<2xf32>,
550550
%arg2: memref<2xf32>) {
@@ -589,7 +589,7 @@ func @nested_regions_and_cond_branch(
589589
// deallocating. It should dealloc %y after CopyOp.
590590

591591
// CHECK-LABEL: func @memref_in_function_results
592-
func @memref_in_function_results(
592+
func.func @memref_in_function_results(
593593
%arg0: memref<5xf32>,
594594
%arg1: memref<10xf32>,
595595
%arg2: memref<5xf32>) -> (memref<10xf32>, memref<15xf32>) {
@@ -615,7 +615,7 @@ func @memref_in_function_results(
615615
// requires a dealloc.
616616

617617
// CHECK-LABEL: func @nested_region_control_flow
618-
func @nested_region_control_flow(
618+
func.func @nested_region_control_flow(
619619
%arg0 : index,
620620
%arg1 : index) -> memref<?x?xf32> {
621621
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -645,7 +645,7 @@ func @nested_region_control_flow(
645645
// returned in the end.
646646

647647
// CHECK-LABEL: func @nested_region_control_flow_div
648-
func @nested_region_control_flow_div(
648+
func.func @nested_region_control_flow_div(
649649
%arg0 : index,
650650
%arg1 : index) -> memref<?x?xf32> {
651651
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -677,7 +677,7 @@ func @nested_region_control_flow_div(
677677
// the method.
678678

679679
// 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> {
681681
%0 = memref.alloc(%arg0, %arg0) : memref<?x?xf32>
682682
%1 = test.region_if %0 : memref<?x?xf32> -> (memref<?x?xf32>) then {
683683
^bb0(%arg1 : memref<?x?xf32>):
@@ -705,7 +705,7 @@ func @inner_region_control_flow(%arg0 : index) -> memref<?x?xf32> {
705705
// -----
706706

707707
// 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>) {
709709
%0 = memref.alloc() : memref<64x4xf32, offset: 0, strides: [4, 1]>
710710
%1 = memref.subview %0[%arg0, %arg1][%arg0, %arg1][%arg0, %arg1] :
711711
memref<64x4xf32, offset: 0, strides: [4, 1]>
@@ -727,7 +727,7 @@ func @subview(%arg0 : index, %arg1 : index, %arg2 : memref<?x?xf32>) {
727727
// Therefore, all allocas are not handled.
728728

729729
// CHECK-LABEL: func @condBranchAlloca
730-
func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
730+
func.func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
731731
cf.cond_br %arg0, ^bb1, ^bb2
732732
^bb1:
733733
cf.br ^bb3(%arg1 : memref<2xf32>)
@@ -754,7 +754,7 @@ func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
754754
// dealloc.
755755

756756
// CHECK-LABEL: func @ifElseAlloca
757-
func @ifElseAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
757+
func.func @ifElseAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
758758
%0 = memref.alloc() : memref<2xf32>
759759
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
760760
cf.cond_br %arg0,
@@ -782,7 +782,7 @@ func @ifElseAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
782782
// -----
783783

784784
// CHECK-LABEL: func @ifElseNestedAlloca
785-
func @ifElseNestedAlloca(
785+
func.func @ifElseNestedAlloca(
786786
%arg0: i1,
787787
%arg1: memref<2xf32>,
788788
%arg2: memref<2xf32>) {
@@ -817,7 +817,7 @@ func @ifElseNestedAlloca(
817817
// -----
818818

819819
// CHECK-LABEL: func @nestedRegionsAndCondBranchAlloca
820-
func @nestedRegionsAndCondBranchAlloca(
820+
func.func @nestedRegionsAndCondBranchAlloca(
821821
%arg0: i1,
822822
%arg1: memref<2xf32>,
823823
%arg2: memref<2xf32>) {
@@ -857,7 +857,7 @@ func @nestedRegionsAndCondBranchAlloca(
857857
// -----
858858

859859
// CHECK-LABEL: func @nestedRegionControlFlowAlloca
860-
func @nestedRegionControlFlowAlloca(
860+
func.func @nestedRegionControlFlowAlloca(
861861
%arg0 : index,
862862
%arg1 : index) -> memref<?x?xf32> {
863863
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -885,7 +885,7 @@ func @nestedRegionControlFlowAlloca(
885885
// memory leaks.
886886

887887
// CHECK-LABEL: func @loop_alloc
888-
func @loop_alloc(
888+
func.func @loop_alloc(
889889
%lb: index,
890890
%ub: index,
891891
%step: index,
@@ -926,7 +926,7 @@ func @loop_alloc(
926926
// that are passed via the backedges.
927927

928928
// CHECK-LABEL: func @loop_nested_if_no_alloc
929-
func @loop_nested_if_no_alloc(
929+
func.func @loop_nested_if_no_alloc(
930930
%lb: index,
931931
%ub: index,
932932
%step: index,
@@ -967,7 +967,7 @@ func @loop_nested_if_no_alloc(
967967
// "returning" %3.
968968

969969
// CHECK-LABEL: func @loop_nested_if_alloc
970-
func @loop_nested_if_alloc(
970+
func.func @loop_nested_if_alloc(
971971
%lb: index,
972972
%ub: index,
973973
%step: index,
@@ -1017,7 +1017,7 @@ func @loop_nested_if_alloc(
10171017
// before each yield in all loops recursively.
10181018

10191019
// CHECK-LABEL: func @loop_nested_alloc
1020-
func @loop_nested_alloc(
1020+
func.func @loop_nested_alloc(
10211021
%lb: index,
10221022
%ub: index,
10231023
%step: index,
@@ -1093,7 +1093,7 @@ func @loop_nested_alloc(
10931093
// -----
10941094

10951095
// CHECK-LABEL: func @affine_loop
1096-
func @affine_loop() {
1096+
func.func @affine_loop() {
10971097
%buffer = memref.alloc() : memref<1024xf32>
10981098
%sum_init_0 = arith.constant 0.0 : f32
10991099
%res = affine.for %i = 0 to 10 step 2 iter_args(%sum_iter = %sum_init_0) -> f32 {
@@ -1115,7 +1115,7 @@ func @affine_loop() {
11151115
// control-flow loop since they are not supported.
11161116

11171117
// expected-error@+1 {{Only structured control-flow loops are supported}}
1118-
func @loop_dynalloc(
1118+
func.func @loop_dynalloc(
11191119
%arg0 : i32,
11201120
%arg1 : i32,
11211121
%arg2: memref<?xf32>,
@@ -1148,7 +1148,7 @@ func @loop_dynalloc(
11481148
// control-flow loop since they are not supported.
11491149

11501150
// expected-error@+1 {{Only structured control-flow loops are supported}}
1151-
func @do_loop_alloc(
1151+
func.func @do_loop_alloc(
11521152
%arg0 : i32,
11531153
%arg1 : i32,
11541154
%arg2: memref<2xf32>,
@@ -1176,7 +1176,7 @@ func @do_loop_alloc(
11761176
// -----
11771177

11781178
// CHECK-LABEL: func @assumingOp(
1179-
func @assumingOp(
1179+
func.func @assumingOp(
11801180
%arg0: !shape.witness,
11811181
%arg2: memref<2xf32>,
11821182
%arg3: memref<2xf32>) {
@@ -1214,7 +1214,7 @@ func @assumingOp(
12141214
// Test Case: The op "test.bar" does not implement the RegionBranchOpInterface.
12151215
// This is not allowed in buffer deallocation.
12161216

1217-
func @noRegionBranchOpInterface() {
1217+
func.func @noRegionBranchOpInterface() {
12181218
// expected-error@+1 {{All operations with attached regions need to implement the RegionBranchOpInterface.}}
12191219
%0 = "test.bar"() ({
12201220
// expected-error@+1 {{All operations with attached regions need to implement the RegionBranchOpInterface.}}
@@ -1235,7 +1235,7 @@ func @noRegionBranchOpInterface() {
12351235
// CHECK-NOT: memref.dealloc %[[RES0]]
12361236
// CHECK: memref.dealloc %[[RES1]]
12371237
// 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> {
12391239
%0 = bufferization.clone %arg0 : memref<?x?xf64> to memref<?x?xf64>
12401240
%1 = bufferization.clone %arg1 : memref<?x?xf64> to memref<?x?xf64>
12411241
return %0 : memref<?x?xf64>
@@ -1244,7 +1244,7 @@ func @dealloc_existing_clones(%arg0: memref<?x?xf64>, %arg1: memref<?x?xf64>) ->
12441244
// -----
12451245

12461246
// CHECK-LABEL: func @while_two_arg
1247-
func @while_two_arg(%arg0: index) {
1247+
func.func @while_two_arg(%arg0: index) {
12481248
%a = memref.alloc(%arg0) : memref<?xf32>
12491249
// CHECK: %[[WHILE:.*]]:2 = scf.while (%[[ARG1:.*]] = %[[ALLOC:.*]], %[[ARG2:.*]] = %[[CLONE:.*]])
12501250
scf.while (%arg1 = %a, %arg2 = %a) : (memref<?xf32>, memref<?xf32>) -> (memref<?xf32>, memref<?xf32>) {
@@ -1271,7 +1271,7 @@ func @while_two_arg(%arg0: index) {
12711271

12721272
// -----
12731273

1274-
func @while_three_arg(%arg0: index) {
1274+
func.func @while_three_arg(%arg0: index) {
12751275
// CHECK: %[[ALLOC:.*]] = memref.alloc
12761276
%a = memref.alloc(%arg0) : memref<?xf32>
12771277
// CHECK-NEXT: %[[CLONE1:.*]] = bufferization.clone %[[ALLOC]]

0 commit comments

Comments
 (0)