Skip to content

Commit

Permalink
[mlir][NFC] Update textual references of func to func.func in Pas…
Browse files Browse the repository at this point in the history
…s/Target tests

The special case parsing of `func` operations is being removed.
  • Loading branch information
River707 committed Apr 21, 2022
1 parent 63237cd commit a4936cb
Show file tree
Hide file tree
Showing 26 changed files with 70 additions and 70 deletions.
2 changes: 1 addition & 1 deletion mlir/test/Pass/dynamic-pipeline-fail-on-parent.mlir
Expand Up @@ -6,6 +6,6 @@
module {
module @inner_mod1 {
"test.symbol"() {sym_name = "foo"} : () -> ()
func private @bar()
func.func private @bar()
}
}
2 changes: 1 addition & 1 deletion mlir/test/Pass/dynamic-pipeline-nested.mlir
Expand Up @@ -4,7 +4,7 @@

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

func @f() {
func.func @f() {
return
}

Expand Down
8 changes: 4 additions & 4 deletions mlir/test/Pass/dynamic-pipeline.mlir
Expand Up @@ -4,7 +4,7 @@
// 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


func @f() {
func.func @f() {
return
}

Expand All @@ -17,14 +17,14 @@ module @inner_mod1 {
// MOD1-NEXT: @foo
// MOD1: Dump Before Canonicalizer
// MOD1-NEXT: @foo
func @foo() {
func.func @foo() {
return
}
// MOD1: Dump Before CSE
// MOD1-NEXT: @baz
// MOD1: Dump Before Canonicalizer
// MOD1-NEXT: @baz
func @baz() {
func.func @baz() {
return
}
}
Expand All @@ -38,7 +38,7 @@ module @inner_mod2 {
// MOD2-NEXT: @foo
// MOD2: Dump Before Canonicalizer
// MOD2-NEXT: @foo
func @foo() {
func.func @foo() {
return
}
}
2 changes: 1 addition & 1 deletion mlir/test/Pass/interface-pass.mlir
Expand Up @@ -3,6 +3,6 @@
// Test that we run the interface pass on the function.

// expected-remark@below {{Executing interface pass on operation}}
func @main() {
func.func @main() {
return
}
2 changes: 1 addition & 1 deletion mlir/test/Pass/invalid-interface-pass.mlir
Expand Up @@ -4,6 +4,6 @@

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

func @main() {
func.func @main() {
return
}
2 changes: 1 addition & 1 deletion mlir/test/Pass/invalid-ir-print-after-failure.mlir
Expand Up @@ -11,6 +11,6 @@

// CHECK-CUSTOM: func @TestCreateInvalidCallInPass
// CHECK-GENERIC: "func.func"
func @TestCreateInvalidCallInPass() {
func.func @TestCreateInvalidCallInPass() {
return
}
2 changes: 1 addition & 1 deletion mlir/test/Pass/invalid-parent.mlir
Expand Up @@ -3,6 +3,6 @@
// Test that we properly report errors when the parent becomes invalid after running a pass
// on a child operation.
// expected-error@below {{'some_unknown_func' does not reference a valid function}}
func @TestCreateInvalidCallInPass() {
func.func @TestCreateInvalidCallInPass() {
return
}
4 changes: 2 additions & 2 deletions mlir/test/Pass/ir-printing.mlir
Expand Up @@ -6,12 +6,12 @@
// 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
// 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

func @foo() {
func.func @foo() {
%0 = arith.constant 0 : i32
return
}

func @bar() {
func.func @bar() {
return
}

Expand Down
12 changes: 6 additions & 6 deletions mlir/test/Pass/pass-timing.mlir
Expand Up @@ -63,28 +63,28 @@
// NESTED_PIPELINE-NEXT: Rest
// NESTED_PIPELINE-NEXT: Total

func @foo() {
func.func @foo() {
return
}

func @bar() {
func.func @bar() {
return
}

func @baz() {
func.func @baz() {
return
}

func @foobar() {
func.func @foobar() {
return
}

module {
func @baz() {
func.func @baz() {
return
}

func @foobar() {
func.func @foobar() {
return
}
}
4 changes: 2 additions & 2 deletions mlir/test/Pass/pipeline-parsing.mlir
Expand Up @@ -11,12 +11,12 @@
// CHECK_ERROR_3: expected ',' after parsing pipeline
// CHECK_ERROR_4: does not refer to a registered pass or pass pipeline
// 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?
func @foo() {
func.func @foo() {
return
}

module {
func @foo() {
func.func @foo() {
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Pass/pipeline-stats.mlir
Expand Up @@ -14,10 +14,10 @@
// PIPELINE-NEXT: TestStatisticPass
// PIPELINE-NEXT: (S) {{0|4}} num-ops - Number of operations counted

func @foo() {
func.func @foo() {
return
}

func @bar() {
func.func @bar() {
return
}
4 changes: 2 additions & 2 deletions mlir/test/Pass/run-reproducer.mlir
Expand Up @@ -5,12 +5,12 @@

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

func @foo() {
func.func @foo() {
%0 = arith.constant 0 : i32
return
}

func @bar() {
func.func @bar() {
return
}

Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Target/Cpp/attrs.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s

// CHECK-LABEL: void opaque_attrs() {
func @opaque_attrs() {
func.func @opaque_attrs() {
// CHECK-NEXT: f(OPAQUE_ENUM_VALUE);
emitc.call "f"() {args = [#emitc.opaque<"OPAQUE_ENUM_VALUE">]} : () -> ()
// CHECK-NEXT: f("some string");
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Target/Cpp/call.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP

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


func @emitc_call_two_results() {
func.func @emitc_call_two_results() {
%0 = arith.constant 0 : index
%1:2 = emitc.call "two_results" () : () -> (i32, i32)
return
Expand Down
20 changes: 10 additions & 10 deletions mlir/test/Target/Cpp/common-cpp.mlir
Expand Up @@ -6,7 +6,7 @@ emitc.include "myheader.h"
emitc.include <"myheader.h">

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

// CHECK: int32_t test_single_return(int32_t [[V2:.*]])
func @test_single_return(%arg0 : i32) -> i32 {
func.func @test_single_return(%arg0 : i32) -> i32 {
// CHECK: return [[V2]]
return %arg0 : i32
}

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

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

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

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

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

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

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

func @apply(%arg0: i32) -> !emitc.opaque<"int32_t*"> {
func.func @apply(%arg0: i32) -> !emitc.opaque<"int32_t*"> {
// CHECK: int32_t* [[V2]] = &[[V1]];
%0 = emitc.apply "&"(%arg0) : (i32) -> !emitc.opaque<"int32_t*">
// CHECK: int32_t [[V3]] = *[[V2]];
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/Target/Cpp/const.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP

func @emitc_constant() {
func.func @emitc_constant() {
%c0 = "emitc.constant"(){value = #emitc.opaque<""> : i32} : () -> i32
%c1 = "emitc.constant"(){value = 42 : i32} : () -> i32
%c2 = "emitc.constant"(){value = -1 : i32} : () -> i32
Expand Down
6 changes: 3 additions & 3 deletions mlir/test/Target/Cpp/control_flow.mlir
Expand Up @@ -2,7 +2,7 @@

// simple(10, true) -> 20
// simple(10, false) -> 30
func @simple(i64, i1) -> i64 {
func.func @simple(i64, i1) -> i64 {
^bb0(%a: i64, %cond: i1):
cf.cond_br %cond, ^bb1, ^bb2
^bb1:
Expand Down Expand Up @@ -43,7 +43,7 @@ func @simple(i64, i1) -> i64 {
// CPP-DECLTOP-NEXT: return [[V0]];


func @block_labels0() {
func.func @block_labels0() {
^bb1:
cf.br ^bb2
^bb2:
Expand All @@ -57,7 +57,7 @@ func @block_labels0() {


// Repeat the same function to make sure the names of the block labels get reset.
func @block_labels1() {
func.func @block_labels1() {
^bb1:
cf.br ^bb2
^bb2:
Expand Down
4 changes: 2 additions & 2 deletions mlir/test/Target/Cpp/for.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP

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

func @test_for_yield() {
func.func @test_for_yield() {
%start = arith.constant 0 : index
%stop = arith.constant 10 : index
%step = arith.constant 1 : index
Expand Down
6 changes: 3 additions & 3 deletions mlir/test/Target/Cpp/if.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT
// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP

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


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


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

0 comments on commit a4936cb

Please sign in to comment.