[Mlir-commits] [mlir] ccaabff - [mlir][NFC] Update textual references of `func` to `func.func` in Analysis/ tests
River Riddle
llvmlistbot at llvm.org
Wed Apr 20 22:24:19 PDT 2022
Author: River Riddle
Date: 2022-04-20T22:17:27-07:00
New Revision: ccaabff1310c08d7e305864ddd8f50027c452080
URL: https://github.com/llvm/llvm-project/commit/ccaabff1310c08d7e305864ddd8f50027c452080
DIFF: https://github.com/llvm/llvm-project/commit/ccaabff1310c08d7e305864ddd8f50027c452080.diff
LOG: [mlir][NFC] Update textual references of `func` to `func.func` in Analysis/ tests
The special case parsing of `func` operations is being removed.
Added:
Modified:
mlir/test/Analysis/test-alias-analysis-modref.mlir
mlir/test/Analysis/test-alias-analysis.mlir
mlir/test/Analysis/test-callgraph.mlir
mlir/test/Analysis/test-dominance.mlir
mlir/test/Analysis/test-liveness.mlir
mlir/test/Analysis/test-match-reduction.mlir
mlir/test/Analysis/test-shape-fn-report.mlir
mlir/test/Analysis/test-topoligical-sort.mlir
Removed:
################################################################################
diff --git a/mlir/test/Analysis/test-alias-analysis-modref.mlir b/mlir/test/Analysis/test-alias-analysis-modref.mlir
index 14502dda3533f..7c5328cb7f750 100644
--- a/mlir/test/Analysis/test-alias-analysis-modref.mlir
+++ b/mlir/test/Analysis/test-alias-analysis-modref.mlir
@@ -4,7 +4,7 @@
// CHECK: alloc -> func.region0#0: NoModRef
// CHECK: dealloc -> func.region0#0: NoModRef
// CHECK: return -> func.region0#0: NoModRef
-func @no_side_effects(%arg: memref<2xf32>) attributes {test.ptr = "func"} {
+func.func @no_side_effects(%arg: memref<2xf32>) attributes {test.ptr = "func"} {
%1 = memref.alloc() {test.ptr = "alloc"} : memref<8x64xf32>
memref.dealloc %1 {test.ptr = "dealloc"} : memref<8x64xf32>
return {test.ptr = "return"}
@@ -18,7 +18,7 @@ func @no_side_effects(%arg: memref<2xf32>) attributes {test.ptr = "func"} {
// CHECK-DAG: store -> func.region0#0: NoModRef
// CHECK-DAG: load -> func.region0#0: NoModRef
-func @simple(%arg: memref<i32>, %value: i32) attributes {test.ptr = "func"} {
+func.func @simple(%arg: memref<i32>, %value: i32) attributes {test.ptr = "func"} {
%1 = memref.alloca() {test.ptr = "alloc"} : memref<i32>
memref.store %value, %1[] {test.ptr = "store"} : memref<i32>
%2 = memref.load %1[] {test.ptr = "load"} : memref<i32>
@@ -33,7 +33,7 @@ func @simple(%arg: memref<i32>, %value: i32) attributes {test.ptr = "func"} {
// CHECK-DAG: store -> func.region0#1: Mod
// CHECK-DAG: load -> func.region0#1: Ref
-func @mayalias(%arg0: memref<i32>, %arg1: memref<i32>, %value: i32) attributes {test.ptr = "func"} {
+func.func @mayalias(%arg0: memref<i32>, %arg1: memref<i32>, %value: i32) attributes {test.ptr = "func"} {
memref.store %value, %arg1[] {test.ptr = "store"} : memref<i32>
%1 = memref.load %arg1[] {test.ptr = "load"} : memref<i32>
return {test.ptr = "return"}
@@ -48,7 +48,7 @@ func @mayalias(%arg0: memref<i32>, %arg1: memref<i32>, %value: i32) attributes {
// TODO: This is provably NoModRef, but requires handling recursive side
// effects.
// CHECK-DAG: if -> alloc#0: ModRef
-func @recursive(%arg0: memref<i32>, %arg1: memref<i32>, %cond: i1, %value: i32) attributes {test.ptr = "func"} {
+func.func @recursive(%arg0: memref<i32>, %arg1: memref<i32>, %cond: i1, %value: i32) attributes {test.ptr = "func"} {
%0 = memref.alloca() {test.ptr = "alloc"} : memref<i32>
scf.if %cond {
memref.store %value, %arg0[] : memref<i32>
@@ -61,7 +61,7 @@ func @recursive(%arg0: memref<i32>, %arg1: memref<i32>, %cond: i1, %value: i32)
// CHECK-LABEL: Testing : "unknown"
// CHECK-DAG: unknown -> func.region0#0: ModRef
-func @unknown(%arg0: memref<i32>) attributes {test.ptr = "func"} {
+func.func @unknown(%arg0: memref<i32>) attributes {test.ptr = "func"} {
"foo.op"() {test.ptr = "unknown"} : () -> ()
return
}
diff --git a/mlir/test/Analysis/test-alias-analysis.mlir b/mlir/test/Analysis/test-alias-analysis.mlir
index d8fd43bfc4bdd..1b9816e4d671c 100644
--- a/mlir/test/Analysis/test-alias-analysis.mlir
+++ b/mlir/test/Analysis/test-alias-analysis.mlir
@@ -20,7 +20,7 @@
// CHECK-DAG: alloc_2#0 <-> func.region0#0: NoAlias
// CHECK-DAG: alloc_2#0 <-> func.region0#1: NoAlias
-func @simple(%arg: memref<2xf32>, %arg1: memref<2xf32>) attributes {test.ptr = "func"} {
+func.func @simple(%arg: memref<2xf32>, %arg1: memref<2xf32>) attributes {test.ptr = "func"} {
%0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
%1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
%2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
@@ -47,7 +47,7 @@ func @simple(%arg: memref<2xf32>, %arg1: memref<2xf32>) attributes {test.ptr = "
// CHECK-DAG: func.region0#1 <-> func.region0.block2#0: NoAlias
// CHECK-DAG: func.region0.block1#0 <-> func.region0.block2#0: MustAlias
-func @control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
+func.func @control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
%0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
%1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
%2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
@@ -80,7 +80,7 @@ func @control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"
// CHECK-DAG: func.region0#1 <-> func.region0.block2#0: NoAlias
// CHECK-DAG: func.region0.block1#0 <-> func.region0.block2#0: MayAlias
-func @control_flow_merge(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
+func.func @control_flow_merge(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
%0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
%1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
%2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
@@ -120,7 +120,7 @@ func @control_flow_merge(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr =
// CHECK-DAG: if_alloc#0 <-> func.region0#0: NoAlias
// CHECK-DAG: if_alloc#0 <-> func.region0#1: NoAlias
-func @region_control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
+func.func @region_control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr = "func"} {
%0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
%1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
%2 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
@@ -177,7 +177,7 @@ func @region_control_flow(%arg: memref<2xf32>, %cond: i1) attributes {test.ptr =
// CHECK-DAG: for_alloca.region0#1 <-> func.region0#1: NoAlias
// CHECK-DAG: for_alloca.region0#1 <-> func.region0#2: NoAlias
// CHECK-DAG: for_alloca.region0#1 <-> func.region0#3: NoAlias
-func @region_loop_control_flow(%arg: memref<2xf32>, %loopI0 : index,
+func.func @region_loop_control_flow(%arg: memref<2xf32>, %loopI0 : index,
%loopI1 : index, %loopI2 : index) attributes {test.ptr = "func"} {
%0 = memref.alloca() {test.ptr = "alloca_1"} : memref<8x64xf32>
%1 = memref.alloca() {test.ptr = "alloca_2"} : memref<8x64xf32>
@@ -198,7 +198,7 @@ func @region_loop_control_flow(%arg: memref<2xf32>, %loopI0 : index,
// CHECK-DAG: view#0 <-> func.region0#0: NoAlias
// CHECK-DAG: view#0 <-> func.region0#1: NoAlias
-func @view_like(%arg: memref<2xf32>, %size: index) attributes {test.ptr = "func"} {
+func.func @view_like(%arg: memref<2xf32>, %size: index) attributes {test.ptr = "func"} {
%1 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
%c0 = arith.constant 0 : index
@@ -222,7 +222,7 @@ func @view_like(%arg: memref<2xf32>, %size: index) attributes {test.ptr = "func"
// CHECK-DAG: constant_2#0 <-> func.region0#0: MayAlias
// CHECK-DAG: constant_3#0 <-> func.region0#0: MayAlias
-func @constants(%arg: memref<2xf32>) attributes {test.ptr = "func"} {
+func.func @constants(%arg: memref<2xf32>) attributes {test.ptr = "func"} {
%1 = memref.alloc() {test.ptr = "alloc_1"} : memref<8x64xf32>
%c0 = arith.constant {test.ptr = "constant_1"} 0 : index
diff --git a/mlir/test/Analysis/test-callgraph.mlir b/mlir/test/Analysis/test-callgraph.mlir
index 1befa5338100b..a316a5c0db0b2 100644
--- a/mlir/test/Analysis/test-callgraph.mlir
+++ b/mlir/test/Analysis/test-callgraph.mlir
@@ -4,22 +4,22 @@
module attributes {test.name = "simple"} {
// CHECK: Node{{.*}}func_a
- func @func_a() {
+ func.func @func_a() {
return
}
- func private @func_b()
+ func.func private @func_b()
// CHECK: Node{{.*}}func_c
// CHECK-NEXT: Call-Edge{{.*}}External-Node
- func @func_c() {
+ func.func @func_c() {
call @func_b() : () -> ()
return
}
// CHECK: Node{{.*}}func_d
// CHECK-NEXT: Call-Edge{{.*}}func_c
- func @func_d() {
+ func.func @func_d() {
call @func_c() : () -> ()
return
}
@@ -28,7 +28,7 @@ module attributes {test.name = "simple"} {
// CHECK-DAG: Call-Edge{{.*}}func_c
// CHECK-DAG: Call-Edge{{.*}}func_d
// CHECK-DAG: Call-Edge{{.*}}func_e
- func @func_e() {
+ func.func @func_e() {
call @func_c() : () -> ()
call @func_d() : () -> ()
call @func_e() : () -> ()
@@ -38,7 +38,7 @@ module attributes {test.name = "simple"} {
// CHECK: Node{{.*}}func_f
// CHECK: Child-Edge{{.*}}test.functional_region_op
// CHECK: Call-Edge{{.*}}test.functional_region_op
- func @func_f() {
+ func.func @func_f() {
// CHECK: Node{{.*}}test.functional_region_op
// CHECK: Call-Edge{{.*}}func_f
%fn = "test.functional_region_op"() ({
@@ -57,14 +57,14 @@ module attributes {test.name = "simple"} {
module attributes {test.name = "nested"} {
module @nested_module {
// CHECK: Node{{.*}}func_a
- func @func_a() {
+ func.func @func_a() {
return
}
}
// CHECK: Node{{.*}}func_b
// CHECK: Call-Edge{{.*}}func_a
- func @func_b() {
+ func.func @func_b() {
"test.conversion_call_op"() { callee = @nested_module::@func_a } : () -> ()
return
}
diff --git a/mlir/test/Analysis/test-dominance.mlir b/mlir/test/Analysis/test-dominance.mlir
index 120b49b5e3f54..b7734151a516f 100644
--- a/mlir/test/Analysis/test-dominance.mlir
+++ b/mlir/test/Analysis/test-dominance.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-opt %s -pass-pipeline="func.func(test-print-dominance)" -split-input-file 2>&1 | FileCheck %s
// CHECK-LABEL: Testing : func_condBranch
-func @func_condBranch(%cond : i1) {
+func.func @func_condBranch(%cond : i1) {
cf.cond_br %cond, ^bb1, ^bb2
^bb1:
cf.br ^exit
@@ -48,7 +48,7 @@ func @func_condBranch(%cond : i1) {
// -----
// CHECK-LABEL: Testing : func_loop
-func @func_loop(%arg0 : i32, %arg1 : i32) {
+func.func @func_loop(%arg0 : i32, %arg1 : i32) {
cf.br ^loopHeader(%arg0 : i32)
^loopHeader(%counter : i32):
%lessThan = arith.cmpi slt, %counter, %arg1 : i32
@@ -90,7 +90,7 @@ func @func_loop(%arg0 : i32, %arg1 : i32) {
// -----
// CHECK-LABEL: Testing : nested_region
-func @nested_region(%arg0 : index, %arg1 : index, %arg2 : index) {
+func.func @nested_region(%arg0 : index, %arg1 : index, %arg2 : index) {
scf.for %arg3 = %arg0 to %arg1 step %arg2 { }
return
}
@@ -109,7 +109,7 @@ func @nested_region(%arg0 : index, %arg1 : index, %arg2 : index) {
// -----
// CHECK-LABEL: Testing : nested_region2
-func @nested_region2(%arg0 : index, %arg1 : index, %arg2 : index) {
+func.func @nested_region2(%arg0 : index, %arg1 : index, %arg2 : index) {
scf.for %arg3 = %arg0 to %arg1 step %arg2 {
scf.for %arg4 = %arg0 to %arg1 step %arg2 {
scf.for %arg5 = %arg0 to %arg1 step %arg2 { }
@@ -147,7 +147,7 @@ func @nested_region2(%arg0 : index, %arg1 : index, %arg2 : index) {
// -----
// CHECK-LABEL: Testing : func_loop_nested_region
-func @func_loop_nested_region(
+func.func @func_loop_nested_region(
%arg0 : i32,
%arg1 : i32,
%arg2 : index,
diff --git a/mlir/test/Analysis/test-liveness.mlir b/mlir/test/Analysis/test-liveness.mlir
index 184c65fbcbccb..2fa291cae3c24 100644
--- a/mlir/test/Analysis/test-liveness.mlir
+++ b/mlir/test/Analysis/test-liveness.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-opt %s -pass-pipeline="func.func(test-print-liveness)" -split-input-file 2>&1 | FileCheck %s
// CHECK-LABEL: Testing : func_empty
-func @func_empty() {
+func.func @func_empty() {
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut:{{ *$}}
@@ -13,7 +13,7 @@ func @func_empty() {
// -----
// CHECK-LABEL: Testing : func_simpleBranch
-func @func_simpleBranch(%arg0: i32, %arg1 : i32) -> i32 {
+func.func @func_simpleBranch(%arg0: i32, %arg1 : i32) -> i32 {
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut: arg0 at 0 arg1 at 0
@@ -36,7 +36,7 @@ func @func_simpleBranch(%arg0: i32, %arg1 : i32) -> i32 {
// -----
// CHECK-LABEL: Testing : func_condBranch
-func @func_condBranch(%cond : i1, %arg1: i32, %arg2 : i32) -> i32 {
+func.func @func_condBranch(%cond : i1, %arg1: i32, %arg2 : i32) -> i32 {
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut: arg1 at 0 arg2 at 0
@@ -69,7 +69,7 @@ func @func_condBranch(%cond : i1, %arg1: i32, %arg2 : i32) -> i32 {
// -----
// CHECK-LABEL: Testing : func_loop
-func @func_loop(%arg0 : i32, %arg1 : i32) -> i32 {
+func.func @func_loop(%arg0 : i32, %arg1 : i32) -> i32 {
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut: arg1 at 0
@@ -115,7 +115,7 @@ func @func_loop(%arg0 : i32, %arg1 : i32) -> i32 {
// -----
// CHECK-LABEL: Testing : func_ranges
-func @func_ranges(%cond : i1, %arg1 : i32, %arg2 : i32, %arg3 : i32) -> i32 {
+func.func @func_ranges(%cond : i1, %arg1 : i32, %arg2 : i32, %arg3 : i32) -> i32 {
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut: arg2 at 0 val_9 val_10
@@ -194,7 +194,7 @@ func @func_ranges(%cond : i1, %arg1 : i32, %arg2 : i32, %arg3 : i32) -> i32 {
// CHECK-LABEL: Testing : nested_region
-func @nested_region(
+func.func @nested_region(
%arg0 : index, %arg1 : index, %arg2 : index,
%arg3 : i32, %arg4 : i32, %arg5 : i32,
%buffer : memref<i32>) -> i32 {
@@ -230,7 +230,7 @@ func @nested_region(
// CHECK-LABEL: Testing : nested_region2
-func @nested_region2(
+func.func @nested_region2(
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut:{{ *$}}
@@ -275,7 +275,7 @@ func @nested_region2(
// CHECK-LABEL: Testing : nested_region3
-func @nested_region3(
+func.func @nested_region3(
// CHECK: Block: 0
// CHECK-NEXT: LiveIn:{{ *$}}
// CHECK-NEXT: LiveOut: arg0 at 0 arg1 at 0 arg2 at 0 arg6 at 0 val_7 val_8
diff --git a/mlir/test/Analysis/test-match-reduction.mlir b/mlir/test/Analysis/test-match-reduction.mlir
index fd5ecc607d1ff..ef99e76066dfd 100644
--- a/mlir/test/Analysis/test-match-reduction.mlir
+++ b/mlir/test/Analysis/test-match-reduction.mlir
@@ -4,7 +4,7 @@
// dialects.
// expected-remark at below {{Testing function}}
-func @linalg_red_add(%in0t : tensor<?xf32>, %out0t : tensor<1xf32>) {
+func.func @linalg_red_add(%in0t : tensor<?xf32>, %out0t : tensor<1xf32>) {
// expected-remark at below {{Reduction found in output #0!}}
// expected-remark at below {{Reduced Value: <block argument> of type 'f32' at index: 0}}
// expected-remark at below {{Combiner Op: %1 = arith.addf %arg2, %arg3 : f32}}
@@ -23,7 +23,7 @@ func @linalg_red_add(%in0t : tensor<?xf32>, %out0t : tensor<1xf32>) {
// -----
// expected-remark at below {{Testing function}}
-func @affine_red_add(%in: memref<256x512xf32>, %out: memref<256xf32>) {
+func.func @affine_red_add(%in: memref<256x512xf32>, %out: memref<256xf32>) {
%cst = arith.constant 0.000000e+00 : f32
affine.for %i = 0 to 256 {
// expected-remark at below {{Reduction found in output #0!}}
@@ -43,7 +43,7 @@ func @affine_red_add(%in: memref<256x512xf32>, %out: memref<256xf32>) {
// TODO: Iteration-carried values with multiple uses are not supported yet.
// expected-remark at below {{Testing function}}
-func @linalg_red_max(%in0t: tensor<4x4xf32>, %out0t: tensor<4xf32>) {
+func.func @linalg_red_max(%in0t: tensor<4x4xf32>, %out0t: tensor<4xf32>) {
// expected-remark at below {{Reduction NOT found in output #0!}}
%red = linalg.generic {indexing_maps = [affine_map<(d0, d1) -> (d0, d1)>,
affine_map<(d0, d1) -> (d0)>],
@@ -61,7 +61,7 @@ func @linalg_red_max(%in0t: tensor<4x4xf32>, %out0t: tensor<4xf32>) {
// -----
// expected-remark at below {{Testing function}}
-func @linalg_fused_red_add(%in0t: tensor<4x4xf32>, %out0t: tensor<4xf32>) {
+func.func @linalg_fused_red_add(%in0t: tensor<4x4xf32>, %out0t: tensor<4xf32>) {
// expected-remark at below {{Reduction found in output #0!}}
// expected-remark at below {{Reduced Value: %2 = arith.subf %1, %arg2 : f32}}
// expected-remark at below {{Combiner Op: %3 = arith.addf %2, %arg3 : f32}}
@@ -82,7 +82,7 @@ func @linalg_fused_red_add(%in0t: tensor<4x4xf32>, %out0t: tensor<4xf32>) {
// -----
// expected-remark at below {{Testing function}}
-func @affine_no_red_rec(%in: memref<512xf32>) {
+func.func @affine_no_red_rec(%in: memref<512xf32>) {
%cst = arith.constant 0.000000e+00 : f32
// %rec is the value loaded in the previous iteration.
// expected-remark at below {{Reduction NOT found in output #0!}}
@@ -97,7 +97,7 @@ func @affine_no_red_rec(%in: memref<512xf32>) {
// -----
// expected-remark at below {{Testing function}}
-func @affine_output_dep(%in: memref<512xf32>) {
+func.func @affine_output_dep(%in: memref<512xf32>) {
%cst = arith.constant 0.000000e+00 : f32
// Reduction %red is not supported because it depends on another
// loop-carried dependence.
diff --git a/mlir/test/Analysis/test-shape-fn-report.mlir b/mlir/test/Analysis/test-shape-fn-report.mlir
index 19c1b0e5a5bfd..a8559b7b9e81f 100644
--- a/mlir/test/Analysis/test-shape-fn-report.mlir
+++ b/mlir/test/Analysis/test-shape-fn-report.mlir
@@ -3,7 +3,7 @@
module attributes {shape.lib = [@shape_lib]} {
// expected-remark at +1 {{associated shape function: same_result_shape}}
-func @tanh(%arg: tensor<10x20xf32>) -> tensor<10x20xf32>
+func.func @tanh(%arg: tensor<10x20xf32>) -> tensor<10x20xf32>
attributes {shape.function = @shape_lib::@same_result_shape} {
// expected-remark at +1 {{no associated way}}
%0 = math.tanh %arg : tensor<10x20xf32>
diff --git a/mlir/test/Analysis/test-topoligical-sort.mlir b/mlir/test/Analysis/test-topoligical-sort.mlir
index d3bed56668fc8..9323c486f8a11 100644
--- a/mlir/test/Analysis/test-topoligical-sort.mlir
+++ b/mlir/test/Analysis/test-topoligical-sort.mlir
@@ -6,7 +6,7 @@
// CHECK: } {__test_sort_original_idx__ = 2 : i64}
// CHECK-NEXT: arith.addi {{.*}} : i32
// CHECK-NEXT: arith.subi {{.*}} : i32
-func @region(
+func.func @region(
%arg0 : index, %arg1 : index, %arg2 : index, %arg3 : index,
%arg4 : i32, %arg5 : i32, %arg6 : i32,
%buffer : memref<i32>) {
More information about the Mlir-commits
mailing list