Skip to content

Commit 63237cd

Browse files
committed
[mlir][NFC] Update textual references of func to func.func in tool/runner tests
The special case parsing of `func` operations is being removed.
1 parent 6a99d29 commit 63237cd

Some content is hidden

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

43 files changed

+294
-294
lines changed

mlir/test/mlir-cpu-runner/X86Vector/math-polynomial-approx-avx2.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// rsqrt.
1515
// -------------------------------------------------------------------------- //
1616

17-
func @rsqrt() {
17+
func.func @rsqrt() {
1818
// Sanity-check that the scalar rsqrt still works OK.
1919
// CHECK: inf
2020
%0 = arith.constant 0.0 : f32
@@ -34,7 +34,7 @@ func @rsqrt() {
3434
return
3535
}
3636

37-
func @main() {
37+
func.func @main() {
3838
call @rsqrt(): () -> ()
3939
return
4040
}

mlir/test/mlir-cpu-runner/async-error.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: -shared-libs=%linalg_test_lib_dir/libmlir_async_runtime%shlibext \
77
// RUN: | FileCheck %s --dump-input=always
88

9-
func @main() {
9+
func.func @main() {
1010
%false = arith.constant 0 : i1
1111

1212
// ------------------------------------------------------------------------ //

mlir/test/mlir-cpu-runner/async-group.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// to keep the bot green for now.
1414
// UNSUPPORTED: asan
1515

16-
func @main() {
16+
func.func @main() {
1717
%c1 = arith.constant 1 : index
1818
%c5 = arith.constant 5 : index
1919

@@ -46,4 +46,4 @@ func @main() {
4646
return
4747
}
4848

49-
func private @mlirAsyncRuntimePrintCurrentThreadId() -> ()
49+
func.func private @mlirAsyncRuntimePrintCurrentThreadId() -> ()

mlir/test/mlir-cpu-runner/async-value.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: -shared-libs=%linalg_test_lib_dir/libmlir_async_runtime%shlibext \
77
// RUN: | FileCheck %s --dump-input=always
88

9-
func @main() {
9+
func.func @main() {
1010

1111
// ------------------------------------------------------------------------ //
1212
// Blocking async.await outside of the async.execute.
@@ -74,5 +74,5 @@ func @main() {
7474
return
7575
}
7676

77-
func private @print_memref_f32(memref<*xf32>)
77+
func.func private @print_memref_f32(memref<*xf32>)
7878
attributes { llvm.emit_c_interface }

mlir/test/mlir-cpu-runner/async.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: -shared-libs=%linalg_test_lib_dir/libmlir_async_runtime%shlibext \
77
// RUN: | FileCheck %s
88

9-
func @main() {
9+
func.func @main() {
1010
%i0 = arith.constant 0 : index
1111
%i1 = arith.constant 1 : index
1212
%i2 = arith.constant 2 : index
@@ -76,6 +76,6 @@ func @main() {
7676
return
7777
}
7878

79-
func private @mlirAsyncRuntimePrintCurrentThreadId() -> ()
79+
func.func private @mlirAsyncRuntimePrintCurrentThreadId() -> ()
8080

81-
func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
81+
func.func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }

mlir/test/mlir-cpu-runner/bare-ptr-call-conv.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// one. 'main' calls 'simple_add1_add2_test' with {1, 1} and {2, 2} so {2, 2}
66
// and {4, 4} are the expected outputs.
77

8-
func @simple_add1_add2_test(%arg0: memref<2xf32>, %arg1: memref<2xf32>) {
8+
func.func @simple_add1_add2_test(%arg0: memref<2xf32>, %arg1: memref<2xf32>) {
99
%c2 = arith.constant 2 : index
1010
%c0 = arith.constant 0 : index
1111
%c1 = arith.constant 1 : index
@@ -28,11 +28,11 @@ func @simple_add1_add2_test(%arg0: memref<2xf32>, %arg1: memref<2xf32>) {
2828
// External declarations.
2929
llvm.func @malloc(i64) -> !llvm.ptr<i8>
3030
llvm.func @free(!llvm.ptr<i8>)
31-
func private @printF32(%arg0: f32)
32-
func private @printComma()
33-
func private @printNewline()
31+
func.func private @printF32(%arg0: f32)
32+
func.func private @printComma()
33+
func.func private @printNewline()
3434

35-
func @main()
35+
func.func @main()
3636
{
3737
%c2 = arith.constant 2 : index
3838
%c0 = arith.constant 0 : index

mlir/test/mlir-cpu-runner/copy.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// RUN: -shared-libs=%mlir_runner_utils_dir/libmlir_runner_utils%shlibext,%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext \
44
// RUN: | FileCheck %s
55

6-
func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
6+
func.func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
77

8-
func @main() -> () {
8+
func.func @main() -> () {
99
%c0 = arith.constant 0 : index
1010
%c1 = arith.constant 1 : index
1111
%c42 = arith.constant 42.0 : f32

mlir/test/mlir-cpu-runner/global-memref.mlir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: mlir-opt %s -pass-pipeline="func.func(convert-arith-to-llvm),convert-memref-to-llvm,convert-func-to-llvm,reconcile-unrealized-casts" | mlir-cpu-runner -e main -entry-point-result=void -shared-libs=%mlir_runner_utils_dir/libmlir_runner_utils%shlibext,%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext | FileCheck %s
22

3-
func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
4-
func private @print_memref_i32(memref<*xi32>) attributes { llvm.emit_c_interface }
5-
func private @printNewline() -> ()
3+
func.func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
4+
func.func private @print_memref_i32(memref<*xi32>) attributes { llvm.emit_c_interface }
5+
func.func private @printNewline() -> ()
66

77
memref.global "private" @gv0 : memref<4xf32> = dense<[0.0, 1.0, 2.0, 3.0]>
8-
func @test1DMemref() {
8+
func.func @test1DMemref() {
99
%0 = memref.get_global @gv0 : memref<4xf32>
1010
%U = memref.cast %0 : memref<4xf32> to memref<*xf32>
1111
// CHECK: rank = 1
@@ -34,7 +34,7 @@ func @test1DMemref() {
3434
}
3535

3636
memref.global constant @gv1 : memref<3x2xi32> = dense<[[0, 1],[2, 3],[4, 5]]>
37-
func @testConstantMemref() {
37+
func.func @testConstantMemref() {
3838
%0 = memref.get_global @gv1 : memref<3x2xi32>
3939
%U = memref.cast %0 : memref<3x2xi32> to memref<*xi32>
4040
// CHECK: rank = 2
@@ -50,7 +50,7 @@ func @testConstantMemref() {
5050
}
5151

5252
memref.global "private" @gv2 : memref<4x2xf32> = dense<[[0.0, 1.0], [2.0, 3.0], [4.0, 5.0], [6.0, 7.0]]>
53-
func @test2DMemref() {
53+
func.func @test2DMemref() {
5454
%0 = memref.get_global @gv2 : memref<4x2xf32>
5555
%U = memref.cast %0 : memref<4x2xf32> to memref<*xf32>
5656
// CHECK: rank = 2
@@ -83,7 +83,7 @@ func @test2DMemref() {
8383
}
8484

8585
memref.global @gv3 : memref<i32> = dense<11>
86-
func @testScalarMemref() {
86+
func.func @testScalarMemref() {
8787
%0 = memref.get_global @gv3 : memref<i32>
8888
%U = memref.cast %0 : memref<i32> to memref<*xi32>
8989
// CHECK: rank = 0
@@ -96,7 +96,7 @@ func @testScalarMemref() {
9696
return
9797
}
9898

99-
func @main() -> () {
99+
func.func @main() -> () {
100100
call @test1DMemref() : () -> ()
101101
call @testConstantMemref() : () -> ()
102102
call @test2DMemref() : () -> ()

mlir/test/mlir-cpu-runner/math-polynomial-approx.mlir

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// -------------------------------------------------------------------------- //
99
// Tanh.
1010
// -------------------------------------------------------------------------- //
11-
func @tanh() {
11+
func.func @tanh() {
1212
// CHECK: 0.848284
1313
%0 = arith.constant 1.25 : f32
1414
%1 = math.tanh %0 : f32
@@ -35,7 +35,7 @@ func @tanh() {
3535
// -------------------------------------------------------------------------- //
3636
// Log.
3737
// -------------------------------------------------------------------------- //
38-
func @log() {
38+
func.func @log() {
3939
// CHECK: 2.64704
4040
%0 = arith.constant 14.112233 : f32
4141
%1 = math.log %0 : f32
@@ -74,7 +74,7 @@ func @log() {
7474
return
7575
}
7676

77-
func @log2() {
77+
func.func @log2() {
7878
// CHECK: 3.81887
7979
%0 = arith.constant 14.112233 : f32
8080
%1 = math.log2 %0 : f32
@@ -113,7 +113,7 @@ func @log2() {
113113
return
114114
}
115115

116-
func @log1p() {
116+
func.func @log1p() {
117117
// CHECK: 0.00995033
118118
%0 = arith.constant 0.01 : f32
119119
%1 = math.log1p %0 : f32
@@ -155,7 +155,7 @@ func @log1p() {
155155
// -------------------------------------------------------------------------- //
156156
// Erf.
157157
// -------------------------------------------------------------------------- //
158-
func @erf() {
158+
func.func @erf() {
159159
// CHECK: -0.000274406
160160
%val1 = arith.constant -2.431864e-4 : f32
161161
%erfVal1 = math.erf %val1 : f32
@@ -227,7 +227,7 @@ func @erf() {
227227
// -------------------------------------------------------------------------- //
228228
// Exp.
229229
// -------------------------------------------------------------------------- //
230-
func @exp() {
230+
func.func @exp() {
231231
// CHECK: 2.71828
232232
%0 = arith.constant 1.0 : f32
233233
%1 = math.exp %0 : f32
@@ -266,7 +266,7 @@ func @exp() {
266266
return
267267
}
268268

269-
func @expm1() {
269+
func.func @expm1() {
270270
// CHECK: 1e-10
271271
%0 = arith.constant 1.0e-10 : f32
272272
%1 = math.expm1 %0 : f32
@@ -307,7 +307,7 @@ func @expm1() {
307307
// -------------------------------------------------------------------------- //
308308
// Sin.
309309
// -------------------------------------------------------------------------- //
310-
func @sin() {
310+
func.func @sin() {
311311
// CHECK: 0
312312
%0 = arith.constant 0.0 : f32
313313
%sin_0 = math.sin %0 : f32
@@ -346,7 +346,7 @@ func @sin() {
346346
// cos.
347347
// -------------------------------------------------------------------------- //
348348

349-
func @cos() {
349+
func.func @cos() {
350350
// CHECK: 1
351351
%0 = arith.constant 0.0 : f32
352352
%cos_0 = math.cos %0 : f32
@@ -385,7 +385,7 @@ func @cos() {
385385
// Atan.
386386
// -------------------------------------------------------------------------- //
387387

388-
func @atan() {
388+
func.func @atan() {
389389
// CHECK: -0.785184
390390
%0 = arith.constant -1.0 : f32
391391
%atan_0 = math.atan %0 : f32
@@ -429,7 +429,7 @@ func @atan() {
429429
// Atan2.
430430
// -------------------------------------------------------------------------- //
431431

432-
func @atan2() {
432+
func.func @atan2() {
433433
%zero = arith.constant 0.0 : f32
434434
%one = arith.constant 1.0 : f32
435435
%two = arith.constant 2.0 : f32
@@ -498,7 +498,7 @@ func @atan2() {
498498
}
499499

500500

501-
func @main() {
501+
func.func @main() {
502502
call @tanh(): () -> ()
503503
call @log(): () -> ()
504504
call @log2(): () -> ()

mlir/test/mlir-cpu-runner/memref-reinterpret-cast.mlir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// RUN: -shared-libs=%mlir_runner_utils_dir/libmlir_runner_utils%shlibext,%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext \
44
// RUN: | FileCheck %s
55

6-
func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
6+
func.func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
77

8-
func @main() -> () {
8+
func.func @main() -> () {
99
%c0 = arith.constant 0 : index
1010
%c1 = arith.constant 1 : index
1111

@@ -35,7 +35,7 @@ func @main() -> () {
3535
return
3636
}
3737

38-
func @cast_ranked_memref_to_static_shape(%input : memref<2x3xf32>) {
38+
func.func @cast_ranked_memref_to_static_shape(%input : memref<2x3xf32>) {
3939
%output = memref.reinterpret_cast %input to
4040
offset: [0], sizes: [6, 1], strides: [1, 1]
4141
: memref<2x3xf32> to memref<6x1xf32>
@@ -53,7 +53,7 @@ func @cast_ranked_memref_to_static_shape(%input : memref<2x3xf32>) {
5353
return
5454
}
5555

56-
func @cast_ranked_memref_to_dynamic_shape(%input : memref<2x3xf32>) {
56+
func.func @cast_ranked_memref_to_dynamic_shape(%input : memref<2x3xf32>) {
5757
%c0 = arith.constant 0 : index
5858
%c1 = arith.constant 1 : index
5959
%c6 = arith.constant 6 : index
@@ -69,7 +69,7 @@ func @cast_ranked_memref_to_dynamic_shape(%input : memref<2x3xf32>) {
6969
return
7070
}
7171

72-
func @cast_unranked_memref_to_static_shape(%input : memref<2x3xf32>) {
72+
func.func @cast_unranked_memref_to_static_shape(%input : memref<2x3xf32>) {
7373
%unranked_input = memref.cast %input : memref<2x3xf32> to memref<*xf32>
7474
%output = memref.reinterpret_cast %unranked_input to
7575
offset: [0], sizes: [6, 1], strides: [1, 1]
@@ -88,7 +88,7 @@ func @cast_unranked_memref_to_static_shape(%input : memref<2x3xf32>) {
8888
return
8989
}
9090

91-
func @cast_unranked_memref_to_dynamic_shape(%input : memref<2x3xf32>) {
91+
func.func @cast_unranked_memref_to_dynamic_shape(%input : memref<2x3xf32>) {
9292
%unranked_input = memref.cast %input : memref<2x3xf32> to memref<*xf32>
9393
%c0 = arith.constant 0 : index
9494
%c1 = arith.constant 1 : index

mlir/test/mlir-cpu-runner/memref-reshape.mlir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// RUN: | FileCheck %s
55

66

7-
func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
7+
func.func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface }
88

9-
func @main() -> () {
9+
func.func @main() -> () {
1010
%c0 = arith.constant 0 : index
1111
%c1 = arith.constant 1 : index
1212

@@ -48,7 +48,7 @@ func @main() -> () {
4848
return
4949
}
5050

51-
func @reshape_ranked_memref_to_ranked(%input : memref<2x3xf32>,
51+
func.func @reshape_ranked_memref_to_ranked(%input : memref<2x3xf32>,
5252
%shape : memref<2xindex>) {
5353
%output = memref.reshape %input(%shape)
5454
: (memref<2x3xf32>, memref<2xindex>) -> memref<?x?xf32>
@@ -62,7 +62,7 @@ func @reshape_ranked_memref_to_ranked(%input : memref<2x3xf32>,
6262
return
6363
}
6464

65-
func @reshape_unranked_memref_to_ranked(%input : memref<2x3xf32>,
65+
func.func @reshape_unranked_memref_to_ranked(%input : memref<2x3xf32>,
6666
%shape : memref<2xindex>) {
6767
%unranked_input = memref.cast %input : memref<2x3xf32> to memref<*xf32>
6868
%output = memref.reshape %input(%shape)
@@ -77,7 +77,7 @@ func @reshape_unranked_memref_to_ranked(%input : memref<2x3xf32>,
7777
return
7878
}
7979

80-
func @reshape_ranked_memref_to_unranked(%input : memref<2x3xf32>,
80+
func.func @reshape_ranked_memref_to_unranked(%input : memref<2x3xf32>,
8181
%shape : memref<2xindex>) {
8282
%dyn_size_shape = memref.cast %shape : memref<2xindex> to memref<?xindex>
8383
%output = memref.reshape %input(%dyn_size_shape)
@@ -91,7 +91,7 @@ func @reshape_ranked_memref_to_unranked(%input : memref<2x3xf32>,
9191
return
9292
}
9393

94-
func @reshape_unranked_memref_to_unranked(%input : memref<2x3xf32>,
94+
func.func @reshape_unranked_memref_to_unranked(%input : memref<2x3xf32>,
9595
%shape : memref<2xindex>) {
9696
%unranked_input = memref.cast %input : memref<2x3xf32> to memref<*xf32>
9797
%dyn_size_shape = memref.cast %shape : memref<2xindex> to memref<?xindex>

mlir/test/mlir-cpu-runner/print.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
llvm.mlir.global internal constant @str_global("String to print\0A")
88
llvm.func @print_c_string(!llvm.ptr<i8>)
99

10-
func @main() {
10+
func.func @main() {
1111
%0 = llvm.mlir.addressof @str_global : !llvm.ptr<array<16 x i8>>
1212
%1 = llvm.mlir.constant(0 : index) : i64
1313
%2 = llvm.getelementptr %0[%1, %1]

0 commit comments

Comments
 (0)