Skip to content

Commit cda6aa7

Browse files
committed
[mlir][NFC] Update textual references of func to func.func in Transform tests
The special case parsing of `func` operations is being removed.
1 parent a4936cb commit cda6aa7

File tree

62 files changed

+704
-704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+704
-704
lines changed

mlir/test/Transforms/buffer-hoisting.mlir

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// the entry block.
1414

1515
// CHECK-LABEL: func @condBranch
16-
func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
16+
func.func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
1717
cf.cond_br %arg0, ^bb1, ^bb2
1818
^bb1:
1919
cf.br ^bb3(%arg1 : memref<2xf32>)
@@ -42,7 +42,7 @@ func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
4242
// %0 in bb2.
4343

4444
// CHECK-LABEL: func @condBranchDynamicType
45-
func @condBranchDynamicType(
45+
func.func @condBranchDynamicType(
4646
%arg0: i1,
4747
%arg1: memref<?xf32>,
4848
%arg2: memref<?xf32>,
@@ -84,7 +84,7 @@ func @condBranchDynamicType(
8484
// %0 in bb2.
8585

8686
// CHECK-LABEL: func @condBranchDynamicTypeNested
87-
func @condBranchDynamicTypeNested(
87+
func.func @condBranchDynamicTypeNested(
8888
%arg0: i1,
8989
%arg1: memref<?xf32>,
9090
%arg2: memref<?xf32>,
@@ -127,7 +127,7 @@ func @condBranchDynamicTypeNested(
127127
// the entry block.
128128

129129
// CHECK-LABEL: func @criticalEdge
130-
func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
130+
func.func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
131131
cf.cond_br %arg0, ^bb1, ^bb2(%arg1 : memref<2xf32>)
132132
^bb1:
133133
%0 = memref.alloc() : memref<2xf32>
@@ -152,7 +152,7 @@ func @criticalEdge(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
152152
// BufferHoisting expected behavior: It shouldn't move the AllocOps.
153153

154154
// CHECK-LABEL: func @ifElse
155-
func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
155+
func.func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
156156
%0 = memref.alloc() : memref<2xf32>
157157
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
158158
cf.cond_br %arg0,
@@ -190,7 +190,7 @@ func @ifElse(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
190190
// BufferHoisting expected behavior: It shouldn't move the AllocOp.
191191

192192
// CHECK-LABEL: func @ifElseNoUsers
193-
func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
193+
func.func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
194194
%0 = memref.alloc() : memref<2xf32>
195195
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
196196
cf.cond_br %arg0,
@@ -222,7 +222,7 @@ func @ifElseNoUsers(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
222222
// BufferHoisting expected behavior: AllocOps shouldn't be moved.
223223

224224
// CHECK-LABEL: func @ifElseNested
225-
func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
225+
func.func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
226226
%0 = memref.alloc() : memref<2xf32>
227227
test.buffer_based in(%arg1: memref<2xf32>) out(%0: memref<2xf32>)
228228
cf.cond_br %arg0,
@@ -258,7 +258,7 @@ func @ifElseNested(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
258258
// BufferHoisting expected behavior: It shouldn't move the AllocOps.
259259

260260
// CHECK-LABEL: func @redundantOperations
261-
func @redundantOperations(%arg0: memref<2xf32>) {
261+
func.func @redundantOperations(%arg0: memref<2xf32>) {
262262
%0 = memref.alloc() : memref<2xf32>
263263
test.buffer_based in(%arg0: memref<2xf32>) out(%0: memref<2xf32>)
264264
%1 = memref.alloc() : memref<2xf32>
@@ -283,7 +283,7 @@ func @redundantOperations(%arg0: memref<2xf32>) {
283283
// entry block.
284284

285285
// CHECK-LABEL: func @moving_alloc_and_inserting_missing_dealloc
286-
func @moving_alloc_and_inserting_missing_dealloc(
286+
func.func @moving_alloc_and_inserting_missing_dealloc(
287287
%cond: i1,
288288
%arg0: memref<2xf32>,
289289
%arg1: memref<2xf32>) {
@@ -318,7 +318,7 @@ func @moving_alloc_and_inserting_missing_dealloc(
318318
// block.
319319

320320
// CHECK-LABEL: func @moving_invalid_dealloc_op_complex
321-
func @moving_invalid_dealloc_op_complex(
321+
func.func @moving_invalid_dealloc_op_complex(
322322
%cond: i1,
323323
%arg0: memref<2xf32>,
324324
%arg1: memref<2xf32>) {
@@ -347,7 +347,7 @@ func @moving_invalid_dealloc_op_complex(
347347
// RegionBufferBasedOp should be moved to the entry block.
348348

349349
// CHECK-LABEL: func @nested_regions_and_cond_branch
350-
func @nested_regions_and_cond_branch(
350+
func.func @nested_regions_and_cond_branch(
351351
%arg0: i1,
352352
%arg1: memref<2xf32>,
353353
%arg2: memref<2xf32>) {
@@ -381,7 +381,7 @@ func @nested_regions_and_cond_branch(
381381
// both if branches until it is finally returned.
382382

383383
// CHECK-LABEL: func @nested_region_control_flow
384-
func @nested_region_control_flow(
384+
func.func @nested_region_control_flow(
385385
%arg0 : index,
386386
%arg1 : index) -> memref<?x?xf32> {
387387
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -407,7 +407,7 @@ func @nested_region_control_flow(
407407
// The alloc positions of %1 does not need to be changed. %3 is moved upwards.
408408

409409
// CHECK-LABEL: func @nested_region_control_flow_div
410-
func @nested_region_control_flow_div(
410+
func.func @nested_region_control_flow_div(
411411
%arg0 : index,
412412
%arg1 : index) -> memref<?x?xf32> {
413413
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -433,7 +433,7 @@ func @nested_region_control_flow_div(
433433
// moved upwards.
434434

435435
// CHECK-LABEL: func @nested_region_control_flow_div_nested
436-
func @nested_region_control_flow_div_nested(
436+
func.func @nested_region_control_flow_div_nested(
437437
%arg0 : index,
438438
%arg1 : index) -> memref<?x?xf32> {
439439
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -464,7 +464,7 @@ func @nested_region_control_flow_div_nested(
464464
// this region.
465465

466466
// CHECK-LABEL: func @nested_region_control_flow_div_nested_dependencies
467-
func @nested_region_control_flow_div_nested_dependencies(
467+
func.func @nested_region_control_flow_div_nested_dependencies(
468468
%arg0: i32,
469469
%arg1: i1,
470470
%arg2: index) -> memref<?x?xf32> {
@@ -503,7 +503,7 @@ func @nested_region_control_flow_div_nested_dependencies(
503503
// The alloc positions of %0 does not need to be changed.
504504

505505
// CHECK-LABEL: func @inner_region_control_flow
506-
func @inner_region_control_flow(%arg0 : index) -> memref<?x?xf32> {
506+
func.func @inner_region_control_flow(%arg0 : index) -> memref<?x?xf32> {
507507
%0 = memref.alloc(%arg0, %arg0) : memref<?x?xf32>
508508
%1 = test.region_if %0 : memref<?x?xf32> -> (memref<?x?xf32>) then {
509509
^bb0(%arg1 : memref<?x?xf32>):
@@ -528,7 +528,7 @@ func @inner_region_control_flow(%arg0 : index) -> memref<?x?xf32> {
528528
// The alloc positions of %0 does not need to be changed. %2 is moved upwards.
529529

530530
// CHECK-LABEL: func @inner_region_control_flow_div
531-
func @inner_region_control_flow_div(
531+
func.func @inner_region_control_flow_div(
532532
%arg0 : index,
533533
%arg1 : index) -> memref<?x?xf32> {
534534
%0 = memref.alloc(%arg0, %arg0) : memref<?x?xf32>
@@ -555,7 +555,7 @@ func @inner_region_control_flow_div(
555555
// Test Case: Alloca operations shouldn't be moved.
556556

557557
// CHECK-LABEL: func @condBranchAlloca
558-
func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
558+
func.func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
559559
cf.cond_br %arg0, ^bb1, ^bb2
560560
^bb1:
561561
cf.br ^bb3(%arg1 : memref<2xf32>)
@@ -580,7 +580,7 @@ func @condBranchAlloca(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
580580
// shouldn't be moved analogously to the ifElseNested test.
581581

582582
// CHECK-LABEL: func @ifElseNestedAlloca
583-
func @ifElseNestedAlloca(
583+
func.func @ifElseNestedAlloca(
584584
%arg0: i1,
585585
%arg1: memref<2xf32>,
586586
%arg2: memref<2xf32>) {
@@ -619,7 +619,7 @@ func @ifElseNestedAlloca(
619619
// be moved in the beginning analogous to the nestedRegionsAndCondBranch test.
620620

621621
// CHECK-LABEL: func @nestedRegionsAndCondBranchAlloca
622-
func @nestedRegionsAndCondBranchAlloca(
622+
func.func @nestedRegionsAndCondBranchAlloca(
623623
%arg0: i1,
624624
%arg1: memref<2xf32>,
625625
%arg2: memref<2xf32>) {
@@ -652,7 +652,7 @@ func @nestedRegionsAndCondBranchAlloca(
652652
// The alloc positions of %3 will be moved upwards.
653653

654654
// CHECK-LABEL: func @loop_alloc
655-
func @loop_alloc(
655+
func.func @loop_alloc(
656656
%lb: index,
657657
%ub: index,
658658
%step: index,
@@ -680,7 +680,7 @@ func @loop_alloc(
680680
// The allocation %4 is not moved upwards.
681681

682682
// CHECK-LABEL: func @loop_nested_if_alloc
683-
func @loop_nested_if_alloc(
683+
func.func @loop_nested_if_alloc(
684684
%lb: index,
685685
%ub: index,
686686
%step: index,
@@ -711,7 +711,7 @@ func @loop_nested_if_alloc(
711711
// Same behavior is an loop_nested_if_alloc: The allocs are not moved upwards.
712712

713713
// CHECK-LABEL: func @loop_nested_alloc
714-
func @loop_nested_alloc(
714+
func.func @loop_nested_alloc(
715715
%lb: index,
716716
%ub: index,
717717
%step: index,
@@ -752,7 +752,7 @@ func @loop_nested_alloc(
752752
// -----
753753

754754
// CHECK-LABEL: func @loop_nested_alloc_dyn_dependency
755-
func @loop_nested_alloc_dyn_dependency(
755+
func.func @loop_nested_alloc_dyn_dependency(
756756
%lb: index,
757757
%ub: index,
758758
%step: index,

mlir/test/Transforms/buffer-loop-hoisting.mlir

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// BufferLoopHoisting expected behavior: It should not move the AllocOp.
1313

1414
// CHECK-LABEL: func @condBranch
15-
func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
15+
func.func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
1616
cf.cond_br %arg0, ^bb1, ^bb2
1717
^bb1:
1818
cf.br ^bb3(%arg1 : memref<2xf32>)
@@ -41,7 +41,7 @@ func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
4141
// %0 in bb2.
4242

4343
// CHECK-LABEL: func @condBranchDynamicType
44-
func @condBranchDynamicType(
44+
func.func @condBranchDynamicType(
4545
%arg0: i1,
4646
%arg1: memref<?xf32>,
4747
%arg2: memref<?xf32>,
@@ -73,7 +73,7 @@ func @condBranchDynamicType(
7373
// the RegionBufferBasedOp should not be moved during this pass.
7474

7575
// CHECK-LABEL: func @nested_regions_and_cond_branch
76-
func @nested_regions_and_cond_branch(
76+
func.func @nested_regions_and_cond_branch(
7777
%arg0: i1,
7878
%arg1: memref<2xf32>,
7979
%arg2: memref<2xf32>) {
@@ -107,7 +107,7 @@ func @nested_regions_and_cond_branch(
107107
// both if branches until it is finally returned.
108108

109109
// CHECK-LABEL: func @nested_region_control_flow
110-
func @nested_region_control_flow(
110+
func.func @nested_region_control_flow(
111111
%arg0 : index,
112112
%arg1 : index) -> memref<?x?xf32> {
113113
%0 = arith.cmpi eq, %arg0, %arg1 : index
@@ -132,7 +132,7 @@ func @nested_region_control_flow(
132132
// The alloc positions of %3 should not be changed.
133133

134134
// CHECK-LABEL: func @loop_alloc
135-
func @loop_alloc(
135+
func.func @loop_alloc(
136136
%lb: index,
137137
%ub: index,
138138
%step: index,
@@ -160,7 +160,7 @@ func @loop_alloc(
160160
// The allocation %4 should not be moved upwards due to a back-edge dependency.
161161

162162
// CHECK-LABEL: func @loop_nested_if_alloc
163-
func @loop_nested_if_alloc(
163+
func.func @loop_nested_if_alloc(
164164
%lb: index,
165165
%ub: index,
166166
%step: index,
@@ -192,7 +192,7 @@ func @loop_nested_if_alloc(
192192
// in their positions.
193193

194194
// CHECK-LABEL: func @loop_nested_alloc
195-
func @loop_nested_alloc(
195+
func.func @loop_nested_alloc(
196196
%lb: index,
197197
%ub: index,
198198
%step: index,
@@ -238,7 +238,7 @@ func @loop_nested_alloc(
238238
// -----
239239

240240
// CHECK-LABEL: func @loop_nested_alloc_dyn_dependency
241-
func @loop_nested_alloc_dyn_dependency(
241+
func.func @loop_nested_alloc_dyn_dependency(
242242
%lb: index,
243243
%ub: index,
244244
%step: index,
@@ -281,7 +281,7 @@ func @loop_nested_alloc_dyn_dependency(
281281
// -----
282282

283283
// CHECK-LABEL: func @hoist_one_loop
284-
func @hoist_one_loop(
284+
func.func @hoist_one_loop(
285285
%lb: index,
286286
%ub: index,
287287
%step: index,
@@ -304,7 +304,7 @@ func @hoist_one_loop(
304304
// -----
305305

306306
// CHECK-LABEL: func @no_hoist_one_loop
307-
func @no_hoist_one_loop(
307+
func.func @no_hoist_one_loop(
308308
%lb: index,
309309
%ub: index,
310310
%step: index,
@@ -325,7 +325,7 @@ func @no_hoist_one_loop(
325325
// -----
326326

327327
// CHECK-LABEL: func @hoist_multiple_loop
328-
func @hoist_multiple_loop(
328+
func.func @hoist_multiple_loop(
329329
%lb: index,
330330
%ub: index,
331331
%step: index,
@@ -352,7 +352,7 @@ func @hoist_multiple_loop(
352352
// -----
353353

354354
// CHECK-LABEL: func @no_hoist_one_loop_conditional
355-
func @no_hoist_one_loop_conditional(
355+
func.func @no_hoist_one_loop_conditional(
356356
%lb: index,
357357
%ub: index,
358358
%step: index,
@@ -380,7 +380,7 @@ func @no_hoist_one_loop_conditional(
380380
// -----
381381

382382
// CHECK-LABEL: func @hoist_one_loop_conditional
383-
func @hoist_one_loop_conditional(
383+
func.func @hoist_one_loop_conditional(
384384
%lb: index,
385385
%ub: index,
386386
%step: index,
@@ -411,7 +411,7 @@ func @hoist_one_loop_conditional(
411411
// -----
412412

413413
// CHECK-LABEL: func @no_hoist_one_loop_dependency
414-
func @no_hoist_one_loop_dependency(
414+
func.func @no_hoist_one_loop_dependency(
415415
%lb: index,
416416
%ub: index,
417417
%step: index,
@@ -434,7 +434,7 @@ func @no_hoist_one_loop_dependency(
434434
// -----
435435

436436
// CHECK-LABEL: func @partial_hoist_multiple_loop_dependency
437-
func @partial_hoist_multiple_loop_dependency(
437+
func.func @partial_hoist_multiple_loop_dependency(
438438
%lb: index,
439439
%ub: index,
440440
%step: index,
@@ -464,7 +464,7 @@ func @partial_hoist_multiple_loop_dependency(
464464
// Test with allocas to ensure that op is also considered.
465465

466466
// CHECK-LABEL: func @hoist_alloca
467-
func @hoist_alloca(
467+
func.func @hoist_alloca(
468468
%lb: index,
469469
%ub: index,
470470
%step: index,

0 commit comments

Comments
 (0)