Skip to content

Commit a4936cb

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

26 files changed

+70
-70
lines changed

mlir/test/Pass/dynamic-pipeline-fail-on-parent.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
module {
77
module @inner_mod1 {
88
"test.symbol"() {sym_name = "foo"} : () -> ()
9-
func private @bar()
9+
func.func private @bar()
1010
}
1111
}

mlir/test/Pass/dynamic-pipeline-nested.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Verify that we can schedule a dynamic pipeline on a nested operation
66

7-
func @f() {
7+
func.func @f() {
88
return
99
}
1010

mlir/test/Pass/dynamic-pipeline.mlir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: mlir-opt %s -pass-pipeline='builtin.module(test-dynamic-pipeline{dynamic-pipeline=func.func(cse,canonicalize)})' --mlir-disable-threading -mlir-print-ir-before-all 2>&1 | FileCheck %s --check-prefix=MOD1 --check-prefix=MOD2 --check-prefix=CHECK
55

66

7-
func @f() {
7+
func.func @f() {
88
return
99
}
1010

@@ -17,14 +17,14 @@ module @inner_mod1 {
1717
// MOD1-NEXT: @foo
1818
// MOD1: Dump Before Canonicalizer
1919
// MOD1-NEXT: @foo
20-
func @foo() {
20+
func.func @foo() {
2121
return
2222
}
2323
// MOD1: Dump Before CSE
2424
// MOD1-NEXT: @baz
2525
// MOD1: Dump Before Canonicalizer
2626
// MOD1-NEXT: @baz
27-
func @baz() {
27+
func.func @baz() {
2828
return
2929
}
3030
}
@@ -38,7 +38,7 @@ module @inner_mod2 {
3838
// MOD2-NEXT: @foo
3939
// MOD2: Dump Before Canonicalizer
4040
// MOD2-NEXT: @foo
41-
func @foo() {
41+
func.func @foo() {
4242
return
4343
}
4444
}

mlir/test/Pass/interface-pass.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// Test that we run the interface pass on the function.
44

55
// expected-remark@below {{Executing interface pass on operation}}
6-
func @main() {
6+
func.func @main() {
77
return
88
}

mlir/test/Pass/invalid-interface-pass.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
// CHECK: unable to schedule pass '{{.*}}' on a PassManager intended to run on 'builtin.module'!
66

7-
func @main() {
7+
func.func @main() {
88
return
99
}

mlir/test/Pass/invalid-ir-print-after-failure.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
// CHECK-CUSTOM: func @TestCreateInvalidCallInPass
1313
// CHECK-GENERIC: "func.func"
14-
func @TestCreateInvalidCallInPass() {
14+
func.func @TestCreateInvalidCallInPass() {
1515
return
1616
}

mlir/test/Pass/invalid-parent.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// Test that we properly report errors when the parent becomes invalid after running a pass
44
// on a child operation.
55
// expected-error@below {{'some_unknown_func' does not reference a valid function}}
6-
func @TestCreateInvalidCallInPass() {
6+
func.func @TestCreateInvalidCallInPass() {
77
return
88
}

mlir/test/Pass/ir-printing.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
// RUN: mlir-opt %s -mlir-disable-threading=true -pass-pipeline='func.func(cse,cse)' -mlir-print-ir-after-all -mlir-print-ir-after-change -o /dev/null 2>&1 | FileCheck -check-prefix=AFTER_ALL_CHANGE %s
77
// RUN: not mlir-opt %s -mlir-disable-threading=true -pass-pipeline='func.func(cse,test-pass-failure)' -mlir-print-ir-after-failure -o /dev/null 2>&1 | FileCheck -check-prefix=AFTER_FAILURE %s
88

9-
func @foo() {
9+
func.func @foo() {
1010
%0 = arith.constant 0 : i32
1111
return
1212
}
1313

14-
func @bar() {
14+
func.func @bar() {
1515
return
1616
}
1717

mlir/test/Pass/pass-timing.mlir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,28 @@
6363
// NESTED_PIPELINE-NEXT: Rest
6464
// NESTED_PIPELINE-NEXT: Total
6565

66-
func @foo() {
66+
func.func @foo() {
6767
return
6868
}
6969

70-
func @bar() {
70+
func.func @bar() {
7171
return
7272
}
7373

74-
func @baz() {
74+
func.func @baz() {
7575
return
7676
}
7777

78-
func @foobar() {
78+
func.func @foobar() {
7979
return
8080
}
8181

8282
module {
83-
func @baz() {
83+
func.func @baz() {
8484
return
8585
}
8686

87-
func @foobar() {
87+
func.func @foobar() {
8888
return
8989
}
9090
}

mlir/test/Pass/pipeline-parsing.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
// CHECK_ERROR_3: expected ',' after parsing pipeline
1212
// CHECK_ERROR_4: does not refer to a registered pass or pass pipeline
1313
// CHECK_ERROR_5: Can't add pass '{{.*}}TestModulePass' restricted to 'builtin.module' on a PassManager intended to run on 'func.func', did you intend to nest?
14-
func @foo() {
14+
func.func @foo() {
1515
return
1616
}
1717

1818
module {
19-
func @foo() {
19+
func.func @foo() {
2020
return
2121
}
2222
}

mlir/test/Pass/pipeline-stats.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
// PIPELINE-NEXT: TestStatisticPass
1515
// PIPELINE-NEXT: (S) {{0|4}} num-ops - Number of operations counted
1616

17-
func @foo() {
17+
func.func @foo() {
1818
return
1919
}
2020

21-
func @bar() {
21+
func.func @bar() {
2222
return
2323
}

mlir/test/Pass/run-reproducer.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
// RUN: mlir-opt %s -run-reproducer 2>&1 | FileCheck -check-prefix=BEFORE %s
77

8-
func @foo() {
8+
func.func @foo() {
99
%0 = arith.constant 0 : i32
1010
return
1111
}
1212

13-
func @bar() {
13+
func.func @bar() {
1414
return
1515
}
1616

mlir/test/Target/Cpp/attrs.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s
22

33
// CHECK-LABEL: void opaque_attrs() {
4-
func @opaque_attrs() {
4+
func.func @opaque_attrs() {
55
// CHECK-NEXT: f(OPAQUE_ENUM_VALUE);
66
emitc.call "f"() {args = [#emitc.opaque<"OPAQUE_ENUM_VALUE">]} : () -> ()
77
// CHECK-NEXT: f("some string");

mlir/test/Target/Cpp/call.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
22
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP
33

4-
func @emitc_call() {
4+
func.func @emitc_call() {
55
%0 = emitc.call "func_a" () : () -> i32
66
%1 = emitc.call "func_b" () : () -> i32
77
return
@@ -17,7 +17,7 @@ func @emitc_call() {
1717
// CPP-DECLTOP-NEXT: [[V1:]] = func_b();
1818

1919

20-
func @emitc_call_two_results() {
20+
func.func @emitc_call_two_results() {
2121
%0 = arith.constant 0 : index
2222
%1:2 = emitc.call "two_results" () : () -> (i32, i32)
2323
return

mlir/test/Target/Cpp/common-cpp.mlir

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ emitc.include "myheader.h"
66
emitc.include <"myheader.h">
77

88
// CHECK: void test_foo_print() {
9-
func @test_foo_print() {
9+
func.func @test_foo_print() {
1010
// CHECK: [[V1:[^ ]*]] = foo::constant({0, 1});
1111
%0 = emitc.call "foo::constant"() {args = [dense<[0, 1]> : tensor<2xi32>]} : () -> (i32)
1212
// CHECK: [[V2:[^ ]*]] = foo::op_and_attr({0, 1}, [[V1]]);
@@ -19,13 +19,13 @@ func @test_foo_print() {
1919
}
2020

2121
// CHECK: int32_t test_single_return(int32_t [[V2:.*]])
22-
func @test_single_return(%arg0 : i32) -> i32 {
22+
func.func @test_single_return(%arg0 : i32) -> i32 {
2323
// CHECK: return [[V2]]
2424
return %arg0 : i32
2525
}
2626

2727
// CHECK: std::tuple<int32_t, int32_t> test_multiple_return()
28-
func @test_multiple_return() -> (i32, i32) {
28+
func.func @test_multiple_return() -> (i32, i32) {
2929
// CHECK: std::tie([[V3:.*]], [[V4:.*]]) = foo::blah();
3030
%0:2 = emitc.call "foo::blah"() : () -> (i32, i32)
3131
// CHECK: [[V5:[^ ]*]] = test_single_return([[V3]]);
@@ -35,14 +35,14 @@ func @test_multiple_return() -> (i32, i32) {
3535
}
3636

3737
// CHECK: test_float
38-
func @test_float() {
38+
func.func @test_float() {
3939
// CHECK: foo::constant({(float)0.0e+00, (float)1.000000000e+00})
4040
%0 = emitc.call "foo::constant"() {args = [dense<[0.000000e+00, 1.000000e+00]> : tensor<2xf32>]} : () -> f32
4141
return
4242
}
4343

4444
// CHECK: test_uint
45-
func @test_uint() {
45+
func.func @test_uint() {
4646
// CHECK: uint32_t
4747
%0 = emitc.call "foo::constant"() {args = [dense<[0, 1]> : tensor<2xui32>]} : () -> ui32
4848
// CHECK: uint64_t
@@ -51,28 +51,28 @@ func @test_uint() {
5151
}
5252

5353
// CHECK: int64_t test_plus_int(int64_t [[V1]])
54-
func @test_plus_int(%arg0 : i64) -> i64 {
54+
func.func @test_plus_int(%arg0 : i64) -> i64 {
5555
// CHECK: mhlo::add([[V1]], [[V1]])
5656
%0 = emitc.call "mhlo::add"(%arg0, %arg0) {args = [0 : index, 1 : index]} : (i64, i64) -> i64
5757
return %0 : i64
5858
}
5959

6060
// CHECK: Tensor<float, 2> mixed_types(Tensor<double, 2> [[V1]])
61-
func @mixed_types(%arg0: tensor<2xf64>) -> tensor<2xf32> {
61+
func.func @mixed_types(%arg0: tensor<2xf64>) -> tensor<2xf32> {
6262
// CHECK: foo::mixed_types([[V1]]);
6363
%0 = emitc.call "foo::mixed_types"(%arg0) {args = [0 : index]} : (tensor<2xf64>) -> tensor<2xf32>
6464
return %0 : tensor<2xf32>
6565
}
6666

6767
// CHECK: Tensor<uint64_t> mhlo_convert(Tensor<uint32_t> [[V1]])
68-
func @mhlo_convert(%arg0: tensor<ui32>) -> tensor<ui64> {
68+
func.func @mhlo_convert(%arg0: tensor<ui32>) -> tensor<ui64> {
6969
// CHECK: mhlo::convert([[V1]]);
7070
%0 = emitc.call "mhlo::convert"(%arg0) {args = [0 : index]} : (tensor<ui32>) -> tensor<ui64>
7171
return %0 : tensor<ui64>
7272
}
7373

7474
// CHECK: status_t opaque_types(bool [[V1:[^ ]*]], char [[V2:[^ ]*]]) {
75-
func @opaque_types(%arg0: !emitc.opaque<"bool">, %arg1: !emitc.opaque<"char">) -> !emitc.opaque<"status_t"> {
75+
func.func @opaque_types(%arg0: !emitc.opaque<"bool">, %arg1: !emitc.opaque<"char">) -> !emitc.opaque<"status_t"> {
7676
// CHECK: int [[V3:[^ ]*]] = a([[V1]], [[V2]]);
7777
%0 = emitc.call "a"(%arg0, %arg1) : (!emitc.opaque<"bool">, !emitc.opaque<"char">) -> (!emitc.opaque<"int">)
7878
// CHECK: char [[V4:[^ ]*]] = b([[V3]]);
@@ -82,7 +82,7 @@ func @opaque_types(%arg0: !emitc.opaque<"bool">, %arg1: !emitc.opaque<"char">) -
8282
return %2 : !emitc.opaque<"status_t">
8383
}
8484

85-
func @apply(%arg0: i32) -> !emitc.opaque<"int32_t*"> {
85+
func.func @apply(%arg0: i32) -> !emitc.opaque<"int32_t*"> {
8686
// CHECK: int32_t* [[V2]] = &[[V1]];
8787
%0 = emitc.apply "&"(%arg0) : (i32) -> !emitc.opaque<"int32_t*">
8888
// CHECK: int32_t [[V3]] = *[[V2]];

mlir/test/Target/Cpp/const.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
22
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP
33

4-
func @emitc_constant() {
4+
func.func @emitc_constant() {
55
%c0 = "emitc.constant"(){value = #emitc.opaque<""> : i32} : () -> i32
66
%c1 = "emitc.constant"(){value = 42 : i32} : () -> i32
77
%c2 = "emitc.constant"(){value = -1 : i32} : () -> i32

mlir/test/Target/Cpp/control_flow.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// simple(10, true) -> 20
44
// simple(10, false) -> 30
5-
func @simple(i64, i1) -> i64 {
5+
func.func @simple(i64, i1) -> i64 {
66
^bb0(%a: i64, %cond: i1):
77
cf.cond_br %cond, ^bb1, ^bb2
88
^bb1:
@@ -43,7 +43,7 @@ func @simple(i64, i1) -> i64 {
4343
// CPP-DECLTOP-NEXT: return [[V0]];
4444

4545

46-
func @block_labels0() {
46+
func.func @block_labels0() {
4747
^bb1:
4848
cf.br ^bb2
4949
^bb2:
@@ -57,7 +57,7 @@ func @block_labels0() {
5757

5858

5959
// Repeat the same function to make sure the names of the block labels get reset.
60-
func @block_labels1() {
60+
func.func @block_labels1() {
6161
^bb1:
6262
cf.br ^bb2
6363
^bb2:

mlir/test/Target/Cpp/for.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
22
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP
33

4-
func @test_for(%arg0 : index, %arg1 : index, %arg2 : index) {
4+
func.func @test_for(%arg0 : index, %arg1 : index, %arg2 : index) {
55
scf.for %i0 = %arg0 to %arg1 step %arg2 {
66
%0 = emitc.call "f"() : () -> i32
77
}
@@ -20,7 +20,7 @@ func @test_for(%arg0 : index, %arg1 : index, %arg2 : index) {
2020
// CPP-DECLTOP-NEXT: }
2121
// CPP-DECLTOP-NEXT: return;
2222

23-
func @test_for_yield() {
23+
func.func @test_for_yield() {
2424
%start = arith.constant 0 : index
2525
%stop = arith.constant 10 : index
2626
%step = arith.constant 1 : index

mlir/test/Target/Cpp/if.mlir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
22
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP
33

4-
func @test_if(%arg0: i1, %arg1: f32) {
4+
func.func @test_if(%arg0: i1, %arg1: f32) {
55
scf.if %arg0 {
66
%0 = emitc.call "func_const"(%arg1) : (f32) -> i32
77
}
@@ -23,7 +23,7 @@ func @test_if(%arg0: i1, %arg1: f32) {
2323
// CPP-DECLTOP-NEXT: return;
2424

2525

26-
func @test_if_else(%arg0: i1, %arg1: f32) {
26+
func.func @test_if_else(%arg0: i1, %arg1: f32) {
2727
scf.if %arg0 {
2828
%0 = emitc.call "func_true"(%arg1) : (f32) -> i32
2929
} else {
@@ -54,7 +54,7 @@ func @test_if_else(%arg0: i1, %arg1: f32) {
5454
// CPP-DECLTOP-NEXT: return;
5555

5656

57-
func @test_if_yield(%arg0: i1, %arg1: f32) {
57+
func.func @test_if_yield(%arg0: i1, %arg1: f32) {
5858
%0 = arith.constant 0 : i8
5959
%x, %y = scf.if %arg0 -> (i32, f64) {
6060
%1 = emitc.call "func_true_1"(%arg1) : (f32) -> i32

0 commit comments

Comments
 (0)