diff --git a/mlir/docs/SymbolsAndSymbolTables.md b/mlir/docs/SymbolsAndSymbolTables.md --- a/mlir/docs/SymbolsAndSymbolTables.md +++ b/mlir/docs/SymbolsAndSymbolTables.md @@ -35,7 +35,7 @@ [referred to](#referencing-a-symbol) by operations like [`std.call`](Dialects/Standard.md#call). -### Defining a Symbol +### Defining or declaring a Symbol A `Symbol` operation should use the `SymbolOpInterface` interface to provide the necessary verification and accessors; it also supports @@ -52,6 +52,9 @@ * No SSA results - Intermixing the different ways to `use` an operation quickly becomes unwieldy and difficult to analyze. +* Whether this operation is a declaration or definition (`isDeclaration`) + - Declarations do not define a new symbol but reference a symbol defined + outside the visible IR. ## Symbol Table @@ -182,7 +185,10 @@ * Public (Default) - The symbol may be referenced from outside of the visible IR. We cannot - assume that all of the uses of this symbol are observable. + assume that all of the uses of this symbol are observable. If the + operation declares a symbol (as opposed to defining it), public + visibility is not allowed because symbol declarations are not intended + to be used from outside the visible IR. * Private diff --git a/mlir/include/mlir/IR/Function.h b/mlir/include/mlir/IR/Function.h --- a/mlir/include/mlir/IR/Function.h +++ b/mlir/include/mlir/IR/Function.h @@ -85,6 +85,12 @@ /// Returns the results types that the callable region produces when executed. ArrayRef getCallableResults() { return getType().getResults(); } + //===--------------------------------------------------------------------===// + // SymbolOpInterface Methods + //===--------------------------------------------------------------------===// + + bool isDeclaration() { return isExternal(); } + private: // This trait needs access to the hooks defined below. friend class OpTrait::FunctionLike; diff --git a/mlir/include/mlir/IR/SymbolInterfaces.td b/mlir/include/mlir/IR/SymbolInterfaces.td --- a/mlir/include/mlir/IR/SymbolInterfaces.td +++ b/mlir/include/mlir/IR/SymbolInterfaces.td @@ -148,6 +148,16 @@ return getVisibility() != ::mlir::SymbolTable::Visibility::Public; }] >, + InterfaceMethod<[{ + Returns true if this operation is a declaration of a symbol (as opposed + to a definition). + }], + "bool", "isDeclaration", (ins), [{}], + /*defaultImplementation=*/[{ + // By default, assume that the operation defines a symbol. + return false; + }] + >, ]; let verify = [{ @@ -157,7 +167,12 @@ if(!concreteOp.getAttr(::mlir::SymbolTable::getSymbolAttrName())) return success(); } - return ::mlir::detail::verifySymbol($_op); + if (::mlir::failed(::mlir::detail::verifySymbol($_op))) + return ::mlir::failure(); + if (concreteOp.isDeclaration() && concreteOp.isPublic()) + return concreteOp.emitOpError("symbol declaration cannot have public " + "visibility"); + return success(); }]; let extraClassDeclaration = [{ diff --git a/mlir/integration_test/Dialect/Linalg/CPU/matmul-vs-matvec.mlir b/mlir/integration_test/Dialect/Linalg/CPU/matmul-vs-matvec.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/matmul-vs-matvec.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/matmul-vs-matvec.mlir @@ -3,7 +3,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) func @matmul(%A: memref, %B: memref) -> (memref) { %c0 = constant 0 : index diff --git a/mlir/integration_test/Dialect/Linalg/CPU/rank-reducing-subview.mlir b/mlir/integration_test/Dialect/Linalg/CPU/rank-reducing-subview.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/rank-reducing-subview.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/rank-reducing-subview.mlir @@ -3,7 +3,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) func @main() { %c0 = constant 0 : index diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns a 1-D buffer of size %s1 filled with the value %f func @alloc_1d_filled_f32(%s1 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-ncw-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-ncw-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-ncw-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-ncw-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 3-D buffer of size (%s1, %s2, %s3) filled with the value %f func @alloc_3d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-nwc-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-nwc-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-nwc-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-1d-nwc-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 3-D buffer of size (%s1, %s2, %s3) filled with the value %f func @alloc_3d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns a 2-D buffer of size (%s1, %s2) filled with the value %f func @alloc_2d_filled_f32(%s1 : index, %s2 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nchw-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nchw-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nchw-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nchw-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 4-D buffer of size (%s1, %s2, %s3, %s4) filled with the value %f func @alloc_4d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %s4 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nhwc-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nhwc-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nhwc-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-2d-nhwc-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 4-D buffer of size (%s1, %s2, %s3, %s4) filled with the value %f func @alloc_4d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %s4 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 3-D buffer of size (%s1, %s2, %s3) filled with the value %f func @alloc_3d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ncdhw-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ncdhw-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ncdhw-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ncdhw-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 5-D buffer of size (%s1, %s2, %s3, %s4, %s5) filled with the value %f func @alloc_5d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %s4 : index, %s5 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ndhwc-call.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ndhwc-call.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ndhwc-call.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-conv-3d-ndhwc-call.mlir @@ -20,7 +20,7 @@ // RUN: -shared-libs=%mlir_integration_test_dir/libmlir_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) // Creates and returns 5-D buffer of size (%s1, %s2, %s3, %s4, %s5) filled with the value %f func @alloc_5d_filled_f32(%s1 : index, %s2 : index, %s3 : index, %s4 : index, %s5 : index, %f : f32) -> memref { diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-elementwise.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-elementwise.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-elementwise.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-elementwise.mlir @@ -16,4 +16,4 @@ return } -func @print_memref_f32(%ptr : tensor<*xf32>) +func private @print_memref_f32(%ptr : tensor<*xf32>) diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-e2e.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-e2e.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-e2e.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-e2e.mlir @@ -31,4 +31,4 @@ // Note that this is skipping a step and we would need at least some function // attribute to declare that this conversion is valid (e.g. when we statically // know that things will play nicely at the C ABI boundary). -func @print_memref_f32(%ptr : tensor<*xf32>) +func private @print_memref_f32(%ptr : tensor<*xf32>) diff --git a/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir b/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir --- a/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir +++ b/mlir/integration_test/Dialect/Linalg/CPU/test-tensor-matmul.mlir @@ -32,4 +32,4 @@ return } -func @print_memref_f32(%ptr : tensor<*xf32>) +func private @print_memref_f32(%ptr : tensor<*xf32>) diff --git a/mlir/integration_test/Dialect/Vector/CPU/test-transfer-to-loops.mlir b/mlir/integration_test/Dialect/Vector/CPU/test-transfer-to-loops.mlir --- a/mlir/integration_test/Dialect/Vector/CPU/test-transfer-to-loops.mlir +++ b/mlir/integration_test/Dialect/Vector/CPU/test-transfer-to-loops.mlir @@ -6,7 +6,7 @@ #map0 = affine_map<(d0, d1) -> (d1, d0)> #map1 = affine_map<(d0, d1) -> (d1)> -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) func @alloc_2d_filled_f32(%arg0: index, %arg1: index) -> memref { %c0 = constant 0 : index diff --git a/mlir/integration_test/Dialect/Vector/CPU/test-vector-distribute.mlir b/mlir/integration_test/Dialect/Vector/CPU/test-vector-distribute.mlir --- a/mlir/integration_test/Dialect/Vector/CPU/test-vector-distribute.mlir +++ b/mlir/integration_test/Dialect/Vector/CPU/test-vector-distribute.mlir @@ -13,7 +13,7 @@ // RUN: mlir-opt %s -test-vector-to-forloop | FileCheck %s -check-prefix=TRANSFORM -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) func @alloc_1d_filled_inc_f32(%arg0: index, %arg1: f32) -> memref { %c0 = constant 0 : index diff --git a/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir b/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir --- a/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir +++ b/mlir/integration_test/Sparse/CPU/matrix-market-example.mlir @@ -8,10 +8,10 @@ // RUN: FileCheck %s module { - func @openMatrix(!llvm.ptr, memref, memref, memref) -> () - func @readMatrixItem(memref, memref, memref) -> () - func @closeMatrix() -> () - func @getMatrix(index) -> (!llvm.ptr) + func private @openMatrix(!llvm.ptr, memref, memref, memref) -> () + func private @readMatrixItem(memref, memref, memref) -> () + func private @closeMatrix() -> () + func private @getMatrix(index) -> (!llvm.ptr) func @entry() { %d0 = constant 0.0 : f64 diff --git a/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp b/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp --- a/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp +++ b/mlir/lib/Conversion/AsyncToLLVM/AsyncToLLVM.cpp @@ -109,7 +109,7 @@ auto addFuncDecl = [&](StringRef name, FunctionType type) { if (module.lookupSymbol(name)) return; - builder.create(module.getLoc(), name, type); + builder.create(module.getLoc(), name, type).setPrivate(); }; MLIRContext *ctx = module.getContext(); diff --git a/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp b/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp --- a/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp +++ b/mlir/lib/Conversion/GPUToVulkan/ConvertGPULaunchFuncToVulkanLaunchFunc.cpp @@ -123,9 +123,8 @@ } // Declare vulkan launch function. - builder.create( - loc, kVulkanLaunch, - FunctionType::get(vulkanLaunchTypes, {}, loc->getContext())); + auto funcType = FunctionType::get(vulkanLaunchTypes, {}, loc->getContext()); + builder.create(loc, kVulkanLaunch, funcType).setPrivate(); return success(); } diff --git a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp --- a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp +++ b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp @@ -77,6 +77,7 @@ // corresponding `_mlir_ciface_xxx` interface so that external libraries see // a normalized ABI. This interface is added during std to llvm conversion. funcOp.setAttr("llvm.emit_c_interface", UnitAttr::get(op->getContext())); + funcOp.setPrivate(); return fnNameAttr; } diff --git a/mlir/test/Analysis/test-callgraph.mlir b/mlir/test/Analysis/test-callgraph.mlir --- a/mlir/test/Analysis/test-callgraph.mlir +++ b/mlir/test/Analysis/test-callgraph.mlir @@ -1,4 +1,4 @@ -// RUN: mlir-opt %s -test-print-callgraph -split-input-file 2>&1 | FileCheck %s +// RUN: mlir-opt %s -test-print-callgraph -split-input-file -allow-unregistered-dialect 2>&1 | FileCheck %s // CHECK-LABEL: Testing : "simple" module attributes {test.name = "simple"} { @@ -8,7 +8,7 @@ return } - func @func_b() + func private @func_b() // CHECK: Node{{.*}}func_c // CHECK-NEXT: Call-Edge{{.*}}External-Node diff --git a/mlir/test/Conversion/AffineToStandard/lower-affine.mlir b/mlir/test/Conversion/AffineToStandard/lower-affine.mlir --- a/mlir/test/Conversion/AffineToStandard/lower-affine.mlir +++ b/mlir/test/Conversion/AffineToStandard/lower-affine.mlir @@ -5,7 +5,7 @@ return // CHECK: return } // CHECK: } -func @body(index) -> () +func private @body(index) -> () // Simple loops are properly converted. // CHECK-LABEL: func @simple_loop @@ -26,9 +26,9 @@ ///////////////////////////////////////////////////////////////////// -func @pre(index) -> () -func @body2(index, index) -> () -func @post(index) -> () +func private @pre(index) -> () +func private @body2(index, index) -> () +func private @post(index) -> () // CHECK-LABEL: func @imperfectly_nested_loops // CHECK-NEXT: %[[c0:.*]] = constant 0 : index @@ -59,8 +59,8 @@ ///////////////////////////////////////////////////////////////////// -func @mid(index) -> () -func @body3(index, index) -> () +func private @mid(index) -> () +func private @body3(index, index) -> () // CHECK-LABEL: func @more_imperfectly_nested_loops // CHECK-NEXT: %[[c0:.*]] = constant 0 : index @@ -123,7 +123,7 @@ ///////////////////////////////////////////////////////////////////// -func @get_idx() -> (index) +func private @get_idx() -> (index) #set1 = affine_set<(d0) : (20 - d0 >= 0)> #set2 = affine_set<(d0) : (d0 - 10 >= 0)> diff --git a/mlir/test/Conversion/SCFToStandard/convert-to-cfg.mlir b/mlir/test/Conversion/SCFToStandard/convert-to-cfg.mlir --- a/mlir/test/Conversion/SCFToStandard/convert-to-cfg.mlir +++ b/mlir/test/Conversion/SCFToStandard/convert-to-cfg.mlir @@ -314,7 +314,7 @@ return %r : f32 } -func @generate() -> i64 +func private @generate() -> i64 // CHECK-LABEL: @simple_parallel_reduce_loop // CHECK-SAME: %[[LB:.*]]: index, %[[UB:.*]]: index, %[[STEP:.*]]: index, %[[INIT:.*]]: f32 diff --git a/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir b/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir --- a/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir +++ b/mlir/test/Conversion/StandardToLLVM/calling-convention.mlir @@ -10,7 +10,7 @@ // CHECK-LABEL: @external // CHECK: %[[ALLOC0:.*]]: !llvm.ptr, %[[ALIGN0:.*]]: !llvm.ptr, %[[OFFSET0:.*]]: !llvm.i64, %[[SIZE00:.*]]: !llvm.i64, %[[SIZE01:.*]]: !llvm.i64, %[[STRIDE00:.*]]: !llvm.i64, %[[STRIDE01:.*]]: !llvm.i64, // CHECK: %[[ALLOC1:.*]]: !llvm.ptr, %[[ALIGN1:.*]]: !llvm.ptr, %[[OFFSET1:.*]]: !llvm.i64) -func @external(%arg0: memref, %arg1: memref) +func private @external(%arg0: memref, %arg1: memref) // Populate the descriptor for arg0. // CHECK: %[[DESC00:.*]] = llvm.mlir.undef : !llvm.struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)> // CHECK: %[[DESC01:.*]] = llvm.insertvalue %arg0, %[[DESC00]][0] @@ -47,7 +47,7 @@ // Verify that the return value is not affected. // CHECK-LABEL: @returner // CHECK: -> !llvm.struct<(struct<(ptr, ptr, i64, array<2 x i64>, array<2 x i64>)>, struct<(ptr, ptr, i64)>)> -func @returner() -> (memref, memref) +func private @returner() -> (memref, memref) // CHECK-LABEL: @caller func @caller() { diff --git a/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir b/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir @@ -1,30 +1,30 @@ // RUN: mlir-opt -convert-std-to-llvm %s | FileCheck %s //CHECK: llvm.func @second_order_arg(!llvm.ptr>) -func @second_order_arg(%arg0 : () -> ()) +func private @second_order_arg(%arg0 : () -> ()) //CHECK: llvm.func @second_order_result() -> !llvm.ptr> -func @second_order_result() -> (() -> ()) +func private @second_order_result() -> (() -> ()) //CHECK: llvm.func @second_order_multi_result() -> !llvm.struct<(ptr>, ptr>, ptr>)> -func @second_order_multi_result() -> (() -> (i32), () -> (i64), () -> (f32)) +func private @second_order_multi_result() -> (() -> (i32), () -> (i64), () -> (f32)) //CHECK: llvm.func @third_order(!llvm.ptr> (ptr>)>>) -> !llvm.ptr> (ptr>)>> -func @third_order(%arg0 : (() -> ()) -> (() -> ())) -> ((() -> ()) -> (() -> ())) +func private @third_order(%arg0 : (() -> ()) -> (() -> ())) -> ((() -> ()) -> (() -> ())) //CHECK: llvm.func @fifth_order_left(!llvm.ptr>)>>)>>)>>) -func @fifth_order_left(%arg0: (((() -> ()) -> ()) -> ()) -> ()) +func private @fifth_order_left(%arg0: (((() -> ()) -> ()) -> ()) -> ()) //CHECK: llvm.func @fifth_order_right(!llvm.ptr> ()>> ()>> ()>>) -func @fifth_order_right(%arg0: () -> (() -> (() -> (() -> ())))) +func private @fifth_order_right(%arg0: () -> (() -> (() -> (() -> ())))) // Check that memrefs are converted to argument packs if appear as function arguments. // CHECK: llvm.func @memref_call_conv(!llvm.ptr, !llvm.ptr, !llvm.i64, !llvm.i64, !llvm.i64) -func @memref_call_conv(%arg0: memref) +func private @memref_call_conv(%arg0: memref) // Same in nested functions. // CHECK: llvm.func @memref_call_conv_nested(!llvm.ptr, ptr, i64, i64, i64)>>) -func @memref_call_conv_nested(%arg0: (memref) -> ()) +func private @memref_call_conv_nested(%arg0: (memref) -> ()) //CHECK-LABEL: llvm.func @pass_through(%arg0: !llvm.ptr>) -> !llvm.ptr> { func @pass_through(%arg0: () -> ()) -> (() -> ()) { @@ -38,7 +38,7 @@ } // CHECK-LABEL: llvm.func @body(!llvm.i32) -func @body(i32) +func private @body(i32) // CHECK-LABEL: llvm.func @indirect_const_call // CHECK-SAME: (%[[ARG0:.*]]: !llvm.i32) { diff --git a/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir b/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir @@ -389,7 +389,7 @@ // ----- // BAREPTR: llvm.func @foo(!llvm.ptr) -> !llvm.ptr -func @foo(memref<10xi8>) -> memref<20xi8> +func private @foo(memref<10xi8>) -> memref<20xi8> // BAREPTR-LABEL: func @check_memref_func_call // BAREPTR-SAME: %[[in:.*]]: !llvm.ptr) -> !llvm.ptr @@ -415,7 +415,7 @@ // ----- // BAREPTR: llvm.func @goo(!llvm.float) -> !llvm.float -func @goo(f32) -> f32 +func private @goo(f32) -> f32 // BAREPTR-LABEL: func @check_scalar_func_call // BAREPTR-SAME: %[[in:.*]]: !llvm.float) @@ -431,8 +431,8 @@ // convention. Check that the conversion to the LLVM-IR dialect doesn't happen // in the presence of unranked memrefs when using such a calling convention. -// BAREPTR: func @hoo(memref<*xi8>) -> memref<*xi8> -func @hoo(memref<*xi8>) -> memref<*xi8> +// BAREPTR: func private @hoo(memref<*xi8>) -> memref<*xi8> +func private @hoo(memref<*xi8>) -> memref<*xi8> // BAREPTR-LABEL: func @check_unranked_memref_func_call(%{{.*}}: memref<*xi8>) -> memref<*xi8> func @check_unranked_memref_func_call(%in: memref<*xi8>) -> memref<*xi8> { diff --git a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir --- a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir +++ b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir @@ -9,8 +9,8 @@ return } -// CHECK-LABEL: func @body(!llvm.i64) -func @body(index) +// CHECK-LABEL: llvm.func @body(!llvm.i64) +func private @body(index) // CHECK-LABEL: func @simple_loop() { // CHECK32-LABEL: func @simple_loop() { @@ -155,12 +155,12 @@ return } -// CHECK-LABEL: func @body_args(!llvm.i64) -> !llvm.i64 -// CHECK32-LABEL: func @body_args(!llvm.i32) -> !llvm.i32 -func @body_args(index) -> index -// CHECK-LABEL: func @other(!llvm.i64, !llvm.i32) -> !llvm.i32 -// CHECK32-LABEL: func @other(!llvm.i32, !llvm.i32) -> !llvm.i32 -func @other(index, i32) -> i32 +// CHECK-LABEL: llvm.func @body_args(!llvm.i64) -> !llvm.i64 +// CHECK32-LABEL: llvm.func @body_args(!llvm.i32) -> !llvm.i32 +func private @body_args(index) -> index +// CHECK-LABEL: llvm.func @other(!llvm.i64, !llvm.i32) -> !llvm.i32 +// CHECK32-LABEL: llvm.func @other(!llvm.i32, !llvm.i32) -> !llvm.i32 +func private @other(index, i32) -> i32 // CHECK-LABEL: func @func_args(%arg0: !llvm.i32, %arg1: !llvm.i32) -> !llvm.i32 { // CHECK-NEXT: {{.*}} = llvm.mlir.constant(0 : i32) : !llvm.i32 @@ -235,17 +235,17 @@ return %7 : i32 } -// CHECK-LABEL: func @pre(!llvm.i64) -// CHECK32-LABEL: func @pre(!llvm.i32) -func @pre(index) +// CHECK-LABEL: llvm.func @pre(!llvm.i64) +// CHECK32-LABEL: llvm.func @pre(!llvm.i32) +func private @pre(index) -// CHECK-LABEL: func @body2(!llvm.i64, !llvm.i64) -// CHECK32-LABEL: func @body2(!llvm.i32, !llvm.i32) -func @body2(index, index) +// CHECK-LABEL: llvm.func @body2(!llvm.i64, !llvm.i64) +// CHECK32-LABEL: llvm.func @body2(!llvm.i32, !llvm.i32) +func private @body2(index, index) -// CHECK-LABEL: func @post(!llvm.i64) -// CHECK32-LABEL: func @post(!llvm.i32) -func @post(index) +// CHECK-LABEL: llvm.func @post(!llvm.i64) +// CHECK32-LABEL: llvm.func @post(!llvm.i32) +func private @post(index) // CHECK-LABEL: func @imperfectly_nested_loops() { // CHECK-NEXT: llvm.br ^bb1 @@ -320,11 +320,11 @@ return } -// CHECK-LABEL: func @mid(!llvm.i64) -func @mid(index) +// CHECK-LABEL: llvm.func @mid(!llvm.i64) +func private @mid(index) -// CHECK-LABEL: func @body3(!llvm.i64, !llvm.i64) -func @body3(index, index) +// CHECK-LABEL: llvm.func @body3(!llvm.i64, !llvm.i64) +func private @body3(index, index) // A complete function transformation check. // CHECK-LABEL: func @more_imperfectly_nested_loops() { @@ -423,22 +423,22 @@ return } -// CHECK-LABEL: func @get_i64() -> !llvm.i64 -func @get_i64() -> (i64) -// CHECK-LABEL: func @get_f32() -> !llvm.float -func @get_f32() -> (f32) -// CHECK-LABEL: func @get_c16() -> !llvm.struct<(half, half)> -func @get_c16() -> (complex) -// CHECK-LABEL: func @get_c32() -> !llvm.struct<(float, float)> -func @get_c32() -> (complex) -// CHECK-LABEL: func @get_c64() -> !llvm.struct<(double, double)> -func @get_c64() -> (complex) -// CHECK-LABEL: func @get_memref() -> !llvm.struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)> -// CHECK32-LABEL: func @get_memref() -> !llvm.struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)> -func @get_memref() -> (memref<42x?x10x?xf32>) - -// CHECK-LABEL: func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> { -// CHECK32-LABEL: func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> { +// CHECK-LABEL: llvm.func @get_i64() -> !llvm.i64 +func private @get_i64() -> (i64) +// CHECK-LABEL: llvm.func @get_f32() -> !llvm.float +func private @get_f32() -> (f32) +// CHECK-LABEL: llvm.func @get_c16() -> !llvm.struct<(half, half)> +func private @get_c16() -> (complex) +// CHECK-LABEL: llvm.func @get_c32() -> !llvm.struct<(float, float)> +func private @get_c32() -> (complex) +// CHECK-LABEL: llvm.func @get_c64() -> !llvm.struct<(double, double)> +func private @get_c64() -> (complex) +// CHECK-LABEL: llvm.func @get_memref() -> !llvm.struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)> +// CHECK32-LABEL: llvm.func @get_memref() -> !llvm.struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)> +func private @get_memref() -> (memref<42x?x10x?xf32>) + +// CHECK-LABEL: llvm.func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> { +// CHECK32-LABEL: llvm.func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr, ptr, i32, array<4 x i32>, array<4 x i32>)>)> { func @multireturn() -> (i64, f32, memref<42x?x10x?xf32>) { ^bb0: // CHECK-NEXT: {{.*}} = llvm.call @get_i64() : () -> !llvm.i64 @@ -464,8 +464,8 @@ } -// CHECK-LABEL: func @multireturn_caller() { -// CHECK32-LABEL: func @multireturn_caller() { +// CHECK-LABEL: llvm.func @multireturn_caller() { +// CHECK32-LABEL: llvm.func @multireturn_caller() { func @multireturn_caller() { ^bb0: // CHECK-NEXT: {{.*}} = llvm.call @multireturn() : () -> !llvm.struct<(i64, float, struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>)> @@ -487,7 +487,7 @@ return } -// CHECK-LABEL: func @vector_ops(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.vec<4 x i1>, %arg2: !llvm.vec<4 x i64>, %arg3: !llvm.vec<4 x i64>) -> !llvm.vec<4 x float> { +// CHECK-LABEL: llvm.func @vector_ops(%arg0: !llvm.vec<4 x float>, %arg1: !llvm.vec<4 x i1>, %arg2: !llvm.vec<4 x i64>, %arg3: !llvm.vec<4 x i64>) -> !llvm.vec<4 x float> { func @vector_ops(%arg0: vector<4xf32>, %arg1: vector<4xi1>, %arg2: vector<4xi64>, %arg3: vector<4xi64>) -> vector<4xf32> { // CHECK-NEXT: %0 = llvm.mlir.constant(dense<4.200000e+01> : vector<4xf32>) : !llvm.vec<4 x float> %0 = constant dense<42.> : vector<4xf32> diff --git a/mlir/test/Conversion/StandardToLLVM/invalid.mlir b/mlir/test/Conversion/StandardToLLVM/invalid.mlir --- a/mlir/test/Conversion/StandardToLLVM/invalid.mlir +++ b/mlir/test/Conversion/StandardToLLVM/invalid.mlir @@ -33,8 +33,8 @@ // ----- // Should not crash on unsupported types in function signatures. -func @unsupported_signature() -> tensor<10 x i32> +func private @unsupported_signature() -> tensor<10 x i32> // ----- -func @partially_supported_signature() -> (vector<10 x i32>, tensor<10 x i32>) +func private @partially_supported_signature() -> (vector<10 x i32>, tensor<10 x i32>) diff --git a/mlir/test/Dialect/Affine/loop-unswitch.mlir b/mlir/test/Dialect/Affine/loop-unswitch.mlir --- a/mlir/test/Dialect/Affine/loop-unswitch.mlir +++ b/mlir/test/Dialect/Affine/loop-unswitch.mlir @@ -18,7 +18,7 @@ } return } -func @external() +func private @external() // CHECK: affine.for %[[I:.*]] = 0 to 100 { // CHECK-NEXT: affine.store %{{.*}}, %[[A]][%[[I]]] @@ -40,10 +40,10 @@ // ----- -func @foo() -func @bar() -func @abc() -func @xyz() +func private @foo() +func private @bar() +func private @abc() +func private @xyz() // CHECK-LABEL: func @if_then_perfect func @if_then_perfect(%A : memref<100xi32>, %v : i32) { @@ -255,4 +255,4 @@ // CHECK-NEXT: } // CHECK-NEXT: return -func @external() +func private @external() diff --git a/mlir/test/Dialect/Affine/simplify-affine-structures.mlir b/mlir/test/Dialect/Affine/simplify-affine-structures.mlir --- a/mlir/test/Dialect/Affine/simplify-affine-structures.mlir +++ b/mlir/test/Dialect/Affine/simplify-affine-structures.mlir @@ -5,7 +5,7 @@ // CHECK-DAG: #[[$SET_7_11:.*]] = affine_set<(d0, d1) : (d0 * 7 + d1 * 5 + 88 == 0, d0 * 5 - d1 * 11 + 60 == 0, d0 * 11 + d1 * 7 - 24 == 0, d0 * 7 + d1 * 5 + 88 == 0)> // An external function that we will use in bodies to avoid DCE. -func @external() -> () +func private @external() -> () // CHECK-LABEL: func @test_gaussian_elimination_empty_set0() { func @test_gaussian_elimination_empty_set0() { @@ -236,7 +236,7 @@ // ----- // An external function that we will use in bodies to avoid DCE. -func @external() -> () +func private @external() -> () // CHECK-DAG: #[[$SET:.*]] = affine_set<()[s0] : (s0 >= 0, -s0 + 50 >= 0) // CHECK-DAG: #[[$EMPTY_SET:.*]] = affine_set<() : (1 == 0) diff --git a/mlir/test/Dialect/GPU/async-region.mlir b/mlir/test/Dialect/GPU/async-region.mlir --- a/mlir/test/Dialect/GPU/async-region.mlir +++ b/mlir/test/Dialect/GPU/async-region.mlir @@ -7,7 +7,7 @@ gpu.func @kernel() kernel { gpu.return } } - func @foo() -> () + func private @foo() -> () // CHECK-LABEL:func @async(%{{.*}}: index) func @async(%sz : index) { diff --git a/mlir/test/Dialect/LLVMIR/invalid.mlir b/mlir/test/Dialect/LLVMIR/invalid.mlir --- a/mlir/test/Dialect/LLVMIR/invalid.mlir +++ b/mlir/test/Dialect/LLVMIR/invalid.mlir @@ -153,7 +153,7 @@ // ----- -func @standard_func_callee() +func private @standard_func_callee() func @call_non_llvm() { // expected-error@+1 {{'llvm.call' op 'standard_func_callee' does not reference a valid LLVM function}} diff --git a/mlir/test/Dialect/Linalg/bufferize.mlir b/mlir/test/Dialect/Linalg/bufferize.mlir --- a/mlir/test/Dialect/Linalg/bufferize.mlir +++ b/mlir/test/Dialect/Linalg/bufferize.mlir @@ -135,7 +135,7 @@ // CHECK-DAG: #[[$MAP0:[0-9a-z]*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1)> // CHECK-DAG: #[[$MAP1:[0-9a-z]*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1 * 2)> -func @make_index() -> index +func private @make_index() -> index // CHECK-LABEL: func @bufferize_subtensor( // CHECK-SAME: %[[T:[0-9a-z]*]]: tensor @@ -168,7 +168,7 @@ // CHECK-DAG: #[[$MAP0:[0-9a-z]*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1)> // CHECK-DAG: #[[$MAP1:[0-9a-z]*]] = affine_map<(d0, d1)[s0, s1] -> (d0 * s1 + s0 + d1 * 2)> -func @make_index() -> index +func private @make_index() -> index // CHECK-LABEL: func @bufferize_subtensor_insert( // CHECK-SAME: %[[T:[0-9a-z]*]]: tensor diff --git a/mlir/test/Dialect/SCF/canonicalize.mlir b/mlir/test/Dialect/SCF/canonicalize.mlir --- a/mlir/test/Dialect/SCF/canonicalize.mlir +++ b/mlir/test/Dialect/SCF/canonicalize.mlir @@ -114,7 +114,7 @@ // ----- -func @side_effect() {} +func private @side_effect() {} func @all_unused() { %c0 = constant 0 : index %c1 = constant 1 : index @@ -140,7 +140,7 @@ // ----- -func @make_i32() -> i32 +func private @make_i32() -> i32 func @for_yields_2(%lb : index, %ub : index, %step : index) -> i32 { %a = call @make_i32() : () -> (i32) diff --git a/mlir/test/Dialect/SPIRV/types.mlir b/mlir/test/Dialect/SPIRV/types.mlir --- a/mlir/test/Dialect/SPIRV/types.mlir +++ b/mlir/test/Dialect/SPIRV/types.mlir @@ -6,84 +6,84 @@ // ArrayType //===----------------------------------------------------------------------===// -// CHECK: func @scalar_array_type(!spv.array<16 x f32>, !spv.array<8 x i32>) -func @scalar_array_type(!spv.array<16xf32>, !spv.array<8 x i32>) -> () +// CHECK: func private @scalar_array_type(!spv.array<16 x f32>, !spv.array<8 x i32>) +func private @scalar_array_type(!spv.array<16xf32>, !spv.array<8 x i32>) -> () -// CHECK: func @vector_array_type(!spv.array<32 x vector<4xf32>>) -func @vector_array_type(!spv.array< 32 x vector<4xf32> >) -> () +// CHECK: func private @vector_array_type(!spv.array<32 x vector<4xf32>>) +func private @vector_array_type(!spv.array< 32 x vector<4xf32> >) -> () -// CHECK: func @array_type_stride(!spv.array<4 x !spv.array<4 x f32, stride=4>, stride=128>) -func @array_type_stride(!spv.array< 4 x !spv.array<4 x f32, stride=4>, stride = 128>) -> () +// CHECK: func private @array_type_stride(!spv.array<4 x !spv.array<4 x f32, stride=4>, stride=128>) +func private @array_type_stride(!spv.array< 4 x !spv.array<4 x f32, stride=4>, stride = 128>) -> () // ----- // expected-error @+1 {{expected '<'}} -func @missing_left_angle_bracket(!spv.array 4xf32>) -> () +func private @missing_left_angle_bracket(!spv.array 4xf32>) -> () // ----- // expected-error @+1 {{expected single integer for array element count}} -func @missing_count(!spv.array) -> () +func private @missing_count(!spv.array) -> () // ----- // expected-error @+1 {{expected 'x' in dimension list}} -func @missing_x(!spv.array<4 f32>) -> () +func private @missing_x(!spv.array<4 f32>) -> () // ----- // expected-error @+1 {{expected non-function type}} -func @missing_element_type(!spv.array<4x>) -> () +func private @missing_element_type(!spv.array<4x>) -> () // ----- // expected-error @+1 {{expected non-function type}} -func @cannot_parse_type(!spv.array<4xblabla>) -> () +func private @cannot_parse_type(!spv.array<4xblabla>) -> () // ----- // expected-error @+1 {{expected single integer for array element count}} -func @more_than_one_dim(!spv.array<4x3xf32>) -> () +func private @more_than_one_dim(!spv.array<4x3xf32>) -> () // ----- // expected-error @+1 {{only 1-D vector allowed but found 'vector<4x3xf32>'}} -func @non_1D_vector(!spv.array<4xvector<4x3xf32>>) -> () +func private @non_1D_vector(!spv.array<4xvector<4x3xf32>>) -> () // ----- // expected-error @+1 {{cannot use 'tensor<4xf32>' to compose SPIR-V types}} -func @tensor_type(!spv.array<4xtensor<4xf32>>) -> () +func private @tensor_type(!spv.array<4xtensor<4xf32>>) -> () // ----- // expected-error @+1 {{cannot use 'bf16' to compose SPIR-V types}} -func @bf16_type(!spv.array<4xbf16>) -> () +func private @bf16_type(!spv.array<4xbf16>) -> () // ----- // expected-error @+1 {{only 1/8/16/32/64-bit integer type allowed but found 'i256'}} -func @i256_type(!spv.array<4xi256>) -> () +func private @i256_type(!spv.array<4xi256>) -> () // ----- // expected-error @+1 {{cannot use 'index' to compose SPIR-V types}} -func @index_type(!spv.array<4xindex>) -> () +func private @index_type(!spv.array<4xindex>) -> () // ----- // expected-error @+1 {{cannot use '!llvm.i32' to compose SPIR-V types}} -func @llvm_type(!spv.array<4x!llvm.i32>) -> () +func private @llvm_type(!spv.array<4x!llvm.i32>) -> () // ----- // expected-error @+1 {{ArrayStride must be greater than zero}} -func @array_type_zero_stride(!spv.array<4xi32, stride=0>) -> () +func private @array_type_zero_stride(!spv.array<4xi32, stride=0>) -> () // ----- // expected-error @+1 {{expected array length greater than 0}} -func @array_type_zero_length(!spv.array<0xf32>) -> () +func private @array_type_zero_length(!spv.array<0xf32>) -> () // ----- @@ -92,33 +92,33 @@ //===----------------------------------------------------------------------===// // CHECK: @bool_ptr_type(!spv.ptr) -func @bool_ptr_type(!spv.ptr) -> () +func private @bool_ptr_type(!spv.ptr) -> () // CHECK: @scalar_ptr_type(!spv.ptr) -func @scalar_ptr_type(!spv.ptr) -> () +func private @scalar_ptr_type(!spv.ptr) -> () // CHECK: @vector_ptr_type(!spv.ptr, PushConstant>) -func @vector_ptr_type(!spv.ptr,PushConstant>) -> () +func private @vector_ptr_type(!spv.ptr,PushConstant>) -> () // ----- // expected-error @+1 {{expected '<'}} -func @missing_left_angle_bracket(!spv.ptr f32, Uniform>) -> () +func private @missing_left_angle_bracket(!spv.ptr f32, Uniform>) -> () // ----- // expected-error @+1 {{expected ','}} -func @missing_comma(!spv.ptr) -> () +func private @missing_comma(!spv.ptr) -> () // ----- // expected-error @+1 {{expected non-function type}} -func @missing_pointee_type(!spv.ptr<, Uniform>) -> () +func private @missing_pointee_type(!spv.ptr<, Uniform>) -> () // ----- // expected-error @+1 {{unknown storage class: SomeStorageClass}} -func @unknown_storage_class(!spv.ptr) -> () +func private @unknown_storage_class(!spv.ptr) -> () // ----- @@ -126,34 +126,34 @@ // RuntimeArrayType //===----------------------------------------------------------------------===// -// CHECK: func @scalar_runtime_array_type(!spv.rtarray, !spv.rtarray) -func @scalar_runtime_array_type(!spv.rtarray, !spv.rtarray) -> () +// CHECK: func private @scalar_runtime_array_type(!spv.rtarray, !spv.rtarray) +func private @scalar_runtime_array_type(!spv.rtarray, !spv.rtarray) -> () -// CHECK: func @vector_runtime_array_type(!spv.rtarray>) -func @vector_runtime_array_type(!spv.rtarray< vector<4xf32> >) -> () +// CHECK: func private @vector_runtime_array_type(!spv.rtarray>) +func private @vector_runtime_array_type(!spv.rtarray< vector<4xf32> >) -> () -// CHECK: func @runtime_array_type_stride(!spv.rtarray) -func @runtime_array_type_stride(!spv.rtarray) -> () +// CHECK: func private @runtime_array_type_stride(!spv.rtarray) +func private @runtime_array_type_stride(!spv.rtarray) -> () // ----- // expected-error @+1 {{expected '<'}} -func @missing_left_angle_bracket(!spv.rtarray f32>) -> () +func private @missing_left_angle_bracket(!spv.rtarray f32>) -> () // ----- // expected-error @+1 {{expected non-function type}} -func @missing_element_type(!spv.rtarray<>) -> () +func private @missing_element_type(!spv.rtarray<>) -> () // ----- // expected-error @+1 {{expected non-function type}} -func @redundant_count(!spv.rtarray<4xf32>) -> () +func private @redundant_count(!spv.rtarray<4xf32>) -> () // ----- // expected-error @+1 {{ArrayStride must be greater than zero}} -func @runtime_array_type_zero_stride(!spv.rtarray) -> () +func private @runtime_array_type_zero_stride(!spv.rtarray) -> () // ----- @@ -161,68 +161,68 @@ // ImageType //===----------------------------------------------------------------------===// -// CHECK: func @image_parameters_1D(!spv.image) -func @image_parameters_1D(!spv.image) -> () +// CHECK: func private @image_parameters_1D(!spv.image) +func private @image_parameters_1D(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_one_element(!spv.image) -> () +func private @image_parameters_one_element(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_two_elements(!spv.image) -> () +func private @image_parameters_two_elements(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_three_elements(!spv.image) -> () +func private @image_parameters_three_elements(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_four_elements(!spv.image) -> () +func private @image_parameters_four_elements(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_five_elements(!spv.image) -> () +func private @image_parameters_five_elements(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_six_elements(!spv.image) -> () +func private @image_parameters_six_elements(!spv.image) -> () // ----- // expected-error @+1 {{expected '<'}} -func @image_parameters_delimiter(!spv.image f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> () +func private @image_parameters_delimiter(!spv.image f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_nocomma_1(!spv.image) -> () +func private @image_parameters_nocomma_1(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_nocomma_2(!spv.image) -> () +func private @image_parameters_nocomma_2(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_nocomma_3(!spv.image) -> () +func private @image_parameters_nocomma_3(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_nocomma_4(!spv.image) -> () +func private @image_parameters_nocomma_4(!spv.image) -> () // ----- // expected-error @+1 {{expected ','}} -func @image_parameters_nocomma_5(!spv.image) -> () +func private @image_parameters_nocomma_5(!spv.image) -> () // ----- @@ -230,119 +230,119 @@ // StructType //===----------------------------------------------------------------------===// -// CHECK: func @struct_type(!spv.struct<(f32)>) -func @struct_type(!spv.struct<(f32)>) -> () +// CHECK: func private @struct_type(!spv.struct<(f32)>) +func private @struct_type(!spv.struct<(f32)>) -> () -// CHECK: func @struct_type2(!spv.struct<(f32 [0])>) -func @struct_type2(!spv.struct<(f32 [0])>) -> () +// CHECK: func private @struct_type2(!spv.struct<(f32 [0])>) +func private @struct_type2(!spv.struct<(f32 [0])>) -> () -// CHECK: func @struct_type_simple(!spv.struct<(f32, !spv.image)>) -func @struct_type_simple(!spv.struct<(f32, !spv.image)>) -> () +// CHECK: func private @struct_type_simple(!spv.struct<(f32, !spv.image)>) +func private @struct_type_simple(!spv.struct<(f32, !spv.image)>) -> () -// CHECK: func @struct_type_with_offset(!spv.struct<(f32 [0], i32 [4])>) -func @struct_type_with_offset(!spv.struct<(f32 [0], i32 [4])>) -> () +// CHECK: func private @struct_type_with_offset(!spv.struct<(f32 [0], i32 [4])>) +func private @struct_type_with_offset(!spv.struct<(f32 [0], i32 [4])>) -> () -// CHECK: func @nested_struct(!spv.struct<(f32, !spv.struct<(f32, i32)>)>) -func @nested_struct(!spv.struct<(f32, !spv.struct<(f32, i32)>)>) +// CHECK: func private @nested_struct(!spv.struct<(f32, !spv.struct<(f32, i32)>)>) +func private @nested_struct(!spv.struct<(f32, !spv.struct<(f32, i32)>)>) -// CHECK: func @nested_struct_with_offset(!spv.struct<(f32 [0], !spv.struct<(f32 [0], i32 [4])> [4])>) -func @nested_struct_with_offset(!spv.struct<(f32 [0], !spv.struct<(f32 [0], i32 [4])> [4])>) +// CHECK: func private @nested_struct_with_offset(!spv.struct<(f32 [0], !spv.struct<(f32 [0], i32 [4])> [4])>) +func private @nested_struct_with_offset(!spv.struct<(f32 [0], !spv.struct<(f32 [0], i32 [4])> [4])>) -// CHECK: func @struct_type_with_decoration(!spv.struct<(f32 [NonWritable])>) -func @struct_type_with_decoration(!spv.struct<(f32 [NonWritable])>) +// CHECK: func private @struct_type_with_decoration(!spv.struct<(f32 [NonWritable])>) +func private @struct_type_with_decoration(!spv.struct<(f32 [NonWritable])>) -// CHECK: func @struct_type_with_decoration_and_offset(!spv.struct<(f32 [0, NonWritable])>) -func @struct_type_with_decoration_and_offset(!spv.struct<(f32 [0, NonWritable])>) +// CHECK: func private @struct_type_with_decoration_and_offset(!spv.struct<(f32 [0, NonWritable])>) +func private @struct_type_with_decoration_and_offset(!spv.struct<(f32 [0, NonWritable])>) -// CHECK: func @struct_type_with_decoration2(!spv.struct<(f32 [NonWritable], i32 [NonReadable])>) -func @struct_type_with_decoration2(!spv.struct<(f32 [NonWritable], i32 [NonReadable])>) +// CHECK: func private @struct_type_with_decoration2(!spv.struct<(f32 [NonWritable], i32 [NonReadable])>) +func private @struct_type_with_decoration2(!spv.struct<(f32 [NonWritable], i32 [NonReadable])>) -// CHECK: func @struct_type_with_decoration3(!spv.struct<(f32, i32 [NonReadable])>) -func @struct_type_with_decoration3(!spv.struct<(f32, i32 [NonReadable])>) +// CHECK: func private @struct_type_with_decoration3(!spv.struct<(f32, i32 [NonReadable])>) +func private @struct_type_with_decoration3(!spv.struct<(f32, i32 [NonReadable])>) -// CHECK: func @struct_type_with_decoration4(!spv.struct<(f32 [0], i32 [4, NonReadable])>) -func @struct_type_with_decoration4(!spv.struct<(f32 [0], i32 [4, NonReadable])>) +// CHECK: func private @struct_type_with_decoration4(!spv.struct<(f32 [0], i32 [4, NonReadable])>) +func private @struct_type_with_decoration4(!spv.struct<(f32 [0], i32 [4, NonReadable])>) -// CHECK: func @struct_type_with_decoration5(!spv.struct<(f32 [NonWritable, NonReadable])>) -func @struct_type_with_decoration5(!spv.struct<(f32 [NonWritable, NonReadable])>) +// CHECK: func private @struct_type_with_decoration5(!spv.struct<(f32 [NonWritable, NonReadable])>) +func private @struct_type_with_decoration5(!spv.struct<(f32 [NonWritable, NonReadable])>) -// CHECK: func @struct_type_with_decoration6(!spv.struct<(f32, !spv.struct<(i32 [NonWritable, NonReadable])>)>) -func @struct_type_with_decoration6(!spv.struct<(f32, !spv.struct<(i32 [NonWritable, NonReadable])>)>) +// CHECK: func private @struct_type_with_decoration6(!spv.struct<(f32, !spv.struct<(i32 [NonWritable, NonReadable])>)>) +func private @struct_type_with_decoration6(!spv.struct<(f32, !spv.struct<(i32 [NonWritable, NonReadable])>)>) -// CHECK: func @struct_type_with_decoration7(!spv.struct<(f32 [0], !spv.struct<(i32, f32 [NonReadable])> [4])>) -func @struct_type_with_decoration7(!spv.struct<(f32 [0], !spv.struct<(i32, f32 [NonReadable])> [4])>) +// CHECK: func private @struct_type_with_decoration7(!spv.struct<(f32 [0], !spv.struct<(i32, f32 [NonReadable])> [4])>) +func private @struct_type_with_decoration7(!spv.struct<(f32 [0], !spv.struct<(i32, f32 [NonReadable])> [4])>) -// CHECK: func @struct_type_with_decoration8(!spv.struct<(f32, !spv.struct<(i32 [0], f32 [4, NonReadable])>)>) -func @struct_type_with_decoration8(!spv.struct<(f32, !spv.struct<(i32 [0], f32 [4, NonReadable])>)>) +// CHECK: func private @struct_type_with_decoration8(!spv.struct<(f32, !spv.struct<(i32 [0], f32 [4, NonReadable])>)>) +func private @struct_type_with_decoration8(!spv.struct<(f32, !spv.struct<(i32 [0], f32 [4, NonReadable])>)>) -// CHECK: func @struct_type_with_matrix_1(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, ColMajor, MatrixStride=16])>) -func @struct_type_with_matrix_1(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, ColMajor, MatrixStride=16])>) +// CHECK: func private @struct_type_with_matrix_1(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, ColMajor, MatrixStride=16])>) +func private @struct_type_with_matrix_1(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, ColMajor, MatrixStride=16])>) -// CHECK: func @struct_type_with_matrix_2(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor, MatrixStride=16])>) -func @struct_type_with_matrix_2(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor, MatrixStride=16])>) +// CHECK: func private @struct_type_with_matrix_2(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor, MatrixStride=16])>) +func private @struct_type_with_matrix_2(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor, MatrixStride=16])>) -// CHECK: func @struct_empty(!spv.struct<()>) -func @struct_empty(!spv.struct<()>) +// CHECK: func private @struct_empty(!spv.struct<()>) +func private @struct_empty(!spv.struct<()>) // ----- // expected-error @+1 {{offset specification must be given for all members}} -func @struct_type_missing_offset1((!spv.struct<(f32, i32 [4])>) -> () +func private @struct_type_missing_offset1((!spv.struct<(f32, i32 [4])>) -> () // ----- // expected-error @+1 {{offset specification must be given for all members}} -func @struct_type_missing_offset2(!spv.struct<(f32 [3], i32)>) -> () +func private @struct_type_missing_offset2(!spv.struct<(f32 [3], i32)>) -> () // ----- // expected-error @+1 {{expected ')'}} -func @struct_type_missing_comma1(!spv.struct<(f32 i32)>) -> () +func private @struct_type_missing_comma1(!spv.struct<(f32 i32)>) -> () // ----- // expected-error @+1 {{expected ')'}} -func @struct_type_missing_comma2(!spv.struct<(f32 [0] i32)>) -> () +func private @struct_type_missing_comma2(!spv.struct<(f32 [0] i32)>) -> () // ----- // expected-error @+1 {{unbalanced ')' character in pretty dialect name}} -func @struct_type_neg_offset(!spv.struct<(f32 [0)>) -> () +func private @struct_type_neg_offset(!spv.struct<(f32 [0)>) -> () // ----- // expected-error @+1 {{unbalanced ']' character in pretty dialect name}} -func @struct_type_neg_offset(!spv.struct<(f32 0])>) -> () +func private @struct_type_neg_offset(!spv.struct<(f32 0])>) -> () // ----- // expected-error @+1 {{expected ']'}} -func @struct_type_neg_offset(!spv.struct<(f32 [NonWritable 0])>) -> () +func private @struct_type_neg_offset(!spv.struct<(f32 [NonWritable 0])>) -> () // ----- // expected-error @+1 {{expected valid keyword}} -func @struct_type_neg_offset(!spv.struct<(f32 [NonWritable, 0])>) -> () +func private @struct_type_neg_offset(!spv.struct<(f32 [NonWritable, 0])>) -> () // ----- // expected-error @+1 {{expected ','}} -func @struct_type_missing_comma(!spv.struct<(f32 [0 NonWritable], i32 [4])>) +func private @struct_type_missing_comma(!spv.struct<(f32 [0 NonWritable], i32 [4])>) // ----- // expected-error @+1 {{expected ']'}} -func @struct_type_missing_comma(!spv.struct<(f32 [0, NonWritable NonReadable], i32 [4])>) +func private @struct_type_missing_comma(!spv.struct<(f32 [0, NonWritable NonReadable], i32 [4])>) // ----- // expected-error @+1 {{expected ']'}} -func @struct_type_missing_comma(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor MatrixStride=16])>) +func private @struct_type_missing_comma(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor MatrixStride=16])>) // ----- // expected-error @+1 {{expected integer value}} -func @struct_missing_member_decorator_value(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor, MatrixStride=])>) +func private @struct_missing_member_decorator_value(!spv.struct<(!spv.matrix<3 x vector<3xf32>> [0, RowMajor, MatrixStride=])>) // ----- @@ -350,74 +350,74 @@ // StructType (identified) //===----------------------------------------------------------------------===// -// CHECK: func @id_struct_empty(!spv.struct) -func @id_struct_empty(!spv.struct) -> () +// CHECK: func private @id_struct_empty(!spv.struct) +func private @id_struct_empty(!spv.struct) -> () // ----- -// CHECK: func @id_struct_simple(!spv.struct) -func @id_struct_simple(!spv.struct) -> () +// CHECK: func private @id_struct_simple(!spv.struct) +func private @id_struct_simple(!spv.struct) -> () // ----- -// CHECK: func @id_struct_multiple_elements(!spv.struct) -func @id_struct_multiple_elements(!spv.struct) -> () +// CHECK: func private @id_struct_multiple_elements(!spv.struct) +func private @id_struct_multiple_elements(!spv.struct) -> () // ----- -// CHECK: func @id_struct_nested_literal(!spv.struct)>) -func @id_struct_nested_literal(!spv.struct)>) -> () +// CHECK: func private @id_struct_nested_literal(!spv.struct)>) +func private @id_struct_nested_literal(!spv.struct)>) -> () // ----- -// CHECK: func @id_struct_nested_id(!spv.struct)>) -func @id_struct_nested_id(!spv.struct)>) -> () +// CHECK: func private @id_struct_nested_id(!spv.struct)>) +func private @id_struct_nested_id(!spv.struct)>) -> () // ----- -// CHECK: func @literal_struct_nested_id(!spv.struct<(!spv.struct)>) -func @literal_struct_nested_id(!spv.struct<(!spv.struct)>) -> () +// CHECK: func private @literal_struct_nested_id(!spv.struct<(!spv.struct)>) +func private @literal_struct_nested_id(!spv.struct<(!spv.struct)>) -> () // ----- -// CHECK: func @id_struct_self_recursive(!spv.struct, Uniform>)>) -func @id_struct_self_recursive(!spv.struct, Uniform>)>) -> () +// CHECK: func private @id_struct_self_recursive(!spv.struct, Uniform>)>) +func private @id_struct_self_recursive(!spv.struct, Uniform>)>) -> () // ----- -// CHECK: func @id_struct_self_recursive2(!spv.struct, Uniform>)>) -func @id_struct_self_recursive2(!spv.struct, Uniform>)>) -> () +// CHECK: func private @id_struct_self_recursive2(!spv.struct, Uniform>)>) +func private @id_struct_self_recursive2(!spv.struct, Uniform>)>) -> () // ----- // expected-error @+1 {{recursive struct reference not nested in struct definition}} -func @id_wrong_recursive_reference(!spv.struct) -> () +func private @id_wrong_recursive_reference(!spv.struct) -> () // ----- // expected-error @+1 {{recursive struct reference not nested in struct definition}} -func @id_struct_recursive_invalid(!spv.struct, Uniform>)>) -> () +func private @id_struct_recursive_invalid(!spv.struct, Uniform>)>) -> () // ----- // expected-error @+1 {{identifier already used for an enclosing struct}} -func @id_struct_redefinition(!spv.struct, Uniform>)>, Uniform>)>) -> () +func private @id_struct_redefinition(!spv.struct, Uniform>)>, Uniform>)>) -> () // ----- // Equivalent to: // struct a { struct b *bPtr; }; // struct b { struct a *aPtr; }; -// CHECK: func @id_struct_recursive(!spv.struct, Uniform>)>, Uniform>)>) -func @id_struct_recursive(!spv.struct, Uniform>)>, Uniform>)>) -> () +// CHECK: func private @id_struct_recursive(!spv.struct, Uniform>)>, Uniform>)>) +func private @id_struct_recursive(!spv.struct, Uniform>)>, Uniform>)>) -> () // ----- // Equivalent to: // struct a { struct b *bPtr; }; // struct b { struct a *aPtr, struct b *bPtr; }; -// CHECK: func @id_struct_recursive(!spv.struct, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>) -func @id_struct_recursive(!spv.struct, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>) -> () +// CHECK: func private @id_struct_recursive(!spv.struct, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>) +func private @id_struct_recursive(!spv.struct, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>) -> () // ----- @@ -425,100 +425,100 @@ // CooperativeMatrix //===----------------------------------------------------------------------===// -// CHECK: func @coop_matrix_type(!spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<8x8xf32, Workgroup>) -func @coop_matrix_type(!spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<8x8xf32, Workgroup>) -> () +// CHECK: func private @coop_matrix_type(!spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<8x8xf32, Workgroup>) +func private @coop_matrix_type(!spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<8x8xf32, Workgroup>) -> () // ----- // expected-error @+1 {{expected ','}} -func @missing_scope(!spv.coopmatrix<8x16xi32>) -> () +func private @missing_scope(!spv.coopmatrix<8x16xi32>) -> () // ----- // expected-error @+1 {{expected rows and columns size}} -func @missing_count(!spv.coopmatrix<8xi32, Subgroup>) -> () +func private @missing_count(!spv.coopmatrix<8xi32, Subgroup>) -> () // ----- //===----------------------------------------------------------------------===// // Matrix //===----------------------------------------------------------------------===// -// CHECK: func @matrix_type(!spv.matrix<2 x vector<2xf16>>) -func @matrix_type(!spv.matrix<2 x vector<2xf16>>) -> () +// CHECK: func private @matrix_type(!spv.matrix<2 x vector<2xf16>>) +func private @matrix_type(!spv.matrix<2 x vector<2xf16>>) -> () // ----- -// CHECK: func @matrix_type(!spv.matrix<3 x vector<3xf32>>) -func @matrix_type(!spv.matrix<3 x vector<3xf32>>) -> () +// CHECK: func private @matrix_type(!spv.matrix<3 x vector<3xf32>>) +func private @matrix_type(!spv.matrix<3 x vector<3xf32>>) -> () // ----- -// CHECK: func @matrix_type(!spv.matrix<4 x vector<4xf16>>) -func @matrix_type(!spv.matrix<4 x vector<4xf16>>) -> () +// CHECK: func private @matrix_type(!spv.matrix<4 x vector<4xf16>>) +func private @matrix_type(!spv.matrix<4 x vector<4xf16>>) -> () // ----- // expected-error @+1 {{matrix is expected to have 2, 3, or 4 columns}} -func @matrix_invalid_size(!spv.matrix<5 x vector<3xf32>>) -> () +func private @matrix_invalid_size(!spv.matrix<5 x vector<3xf32>>) -> () // ----- // expected-error @+1 {{matrix is expected to have 2, 3, or 4 columns}} -func @matrix_invalid_size(!spv.matrix<1 x vector<3xf32>>) -> () +func private @matrix_invalid_size(!spv.matrix<1 x vector<3xf32>>) -> () // ----- // expected-error @+1 {{matrix columns size has to be less than or equal to 4 and greater than or equal 2, but found 5}} -func @matrix_invalid_columns_size(!spv.matrix<3 x vector<5xf32>>) -> () +func private @matrix_invalid_columns_size(!spv.matrix<3 x vector<5xf32>>) -> () // ----- // expected-error @+1 {{matrix columns size has to be less than or equal to 4 and greater than or equal 2, but found 1}} -func @matrix_invalid_columns_size(!spv.matrix<3 x vector<1xf32>>) -> () +func private @matrix_invalid_columns_size(!spv.matrix<3 x vector<1xf32>>) -> () // ----- // expected-error @+1 {{expected '<'}} -func @matrix_invalid_format(!spv.matrix 3 x vector<3xf32>>) -> () +func private @matrix_invalid_format(!spv.matrix 3 x vector<3xf32>>) -> () // ----- // expected-error @+1 {{unbalanced ')' character in pretty dialect name}} -func @matrix_invalid_format(!spv.matrix< 3 x vector<3xf32>) -> () +func private @matrix_invalid_format(!spv.matrix< 3 x vector<3xf32>) -> () // ----- // expected-error @+1 {{expected 'x' in dimension list}} -func @matrix_invalid_format(!spv.matrix<2 vector<3xi32>>) -> () +func private @matrix_invalid_format(!spv.matrix<2 vector<3xi32>>) -> () // ----- // expected-error @+1 {{matrix must be composed using vector type, got 'i32'}} -func @matrix_invalid_type(!spv.matrix< 3 x i32>) -> () +func private @matrix_invalid_type(!spv.matrix< 3 x i32>) -> () // ----- // expected-error @+1 {{matrix must be composed using vector type, got '!spv.array<16 x f32>'}} -func @matrix_invalid_type(!spv.matrix< 3 x !spv.array<16 x f32>>) -> () +func private @matrix_invalid_type(!spv.matrix< 3 x !spv.array<16 x f32>>) -> () // ----- // expected-error @+1 {{matrix must be composed using vector type, got '!spv.rtarray'}} -func @matrix_invalid_type(!spv.matrix< 3 x !spv.rtarray>) -> () +func private @matrix_invalid_type(!spv.matrix< 3 x !spv.rtarray>) -> () // ----- // expected-error @+1 {{matrix columns' elements must be of Float type, got 'i32'}} -func @matrix_invalid_type(!spv.matrix<2 x vector<3xi32>>) -> () +func private @matrix_invalid_type(!spv.matrix<2 x vector<3xi32>>) -> () // ----- // expected-error @+1 {{expected single unsigned integer for number of columns}} -func @matrix_size_type(!spv.matrix< x vector<3xi32>>) -> () +func private @matrix_size_type(!spv.matrix< x vector<3xi32>>) -> () // ----- // expected-error @+1 {{expected single unsigned integer for number of columns}} -func @matrix_size_type(!spv.matrix<2.0 x vector<3xi32>>) -> () +func private @matrix_size_type(!spv.matrix<2.0 x vector<3xi32>>) -> () // ----- diff --git a/mlir/test/Dialect/Standard/func-bufferize.mlir b/mlir/test/Dialect/Standard/func-bufferize.mlir --- a/mlir/test/Dialect/Standard/func-bufferize.mlir +++ b/mlir/test/Dialect/Standard/func-bufferize.mlir @@ -34,22 +34,22 @@ return %0 : tensor } -// CHECK-LABEL: func @source() -> memref +// CHECK-LABEL: func private @source() -> memref // CHECK-LABEL: func @call_source() -> memref { // CHECK: %[[RET:.*]] = call @source() : () -> memref // CHECK: return %[[RET]] : memref -func @source() -> tensor +func private @source() -> tensor func @call_source() -> tensor { %0 = call @source() : () -> tensor return %0 : tensor } -// CHECK-LABEL: func @sink(memref) +// CHECK-LABEL: func private @sink(memref) // CHECK-LABEL: func @call_sink( // CHECK-SAME: %[[ARG:.*]]: memref) { // CHECK: call @sink(%[[ARG]]) : (memref) -> () // CHECK: return -func @sink(tensor) +func private @sink(tensor) func @call_sink(%arg0: tensor) { call @sink(%arg0) : (tensor) -> () return diff --git a/mlir/test/IR/affine-map.mlir b/mlir/test/IR/affine-map.mlir --- a/mlir/test/IR/affine-map.mlir +++ b/mlir/test/IR/affine-map.mlir @@ -190,183 +190,183 @@ #map58 = affine_map<(d0, d1) -> (4*d0 - 2*d0 + d0, (d0 + d1) + (d0 + d1), 2 * (d0 mod 2) - d0 mod 2)> // Single identity maps are removed. -// CHECK: func @f0(memref<2x4xi8, 1>) -func @f0(memref<2x4xi8, #map0, 1>) +// CHECK: @f0(memref<2x4xi8, 1>) +func private @f0(memref<2x4xi8, #map0, 1>) // Single identity maps are removed. -// CHECK: func @f1(memref<2x4xi8, 1>) -func @f1(memref<2x4xi8, #map1, 1>) +// CHECK: @f1(memref<2x4xi8, 1>) +func private @f1(memref<2x4xi8, #map1, 1>) -// CHECK: func @f2(memref) -func @f2(memref) +// CHECK: @f2(memref) +func private @f2(memref) -// CHECK: func @f3(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3(memref<2x4xi8, #map3, 1>) -// CHECK: func @f3a(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3a(memref<2x4xi8, #map3a, 1>) -// CHECK: func @f3b(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3b(memref<2x4xi8, #map3b, 1>) -// CHECK: func @f3c(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3c(memref<2x4xi8, #map3c, 1>) -// CHECK: func @f3d(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3d(memref<2x4xi8, #map3d, 1>) -// CHECK: func @f3e(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3e(memref<2x4xi8, #map3e, 1>) -// CHECK: func @f3f(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3f(memref<2x4xi8, #map3f, 1>) -// CHECK: func @f3g(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3g(memref<2x4xi8, #map3g, 1>) -// CHECK: func @f3h(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3h(memref<2x4xi8, #map3h, 1>) -// CHECK: func @f3i(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3i(memref<2x4xi8, #map3i, 1>) -// CHECK: func @f3j(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3j(memref<2x4xi8, #map3j, 1>) -// CHECK: func @f3k(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3k(memref<2x4xi8, #map3k, 1>) -// CHECK: func @f3l(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f3l(memref<2x4xi8, #map3l, 1>) +// CHECK: @f3(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3(memref<2x4xi8, #map3, 1>) +// CHECK: @f3a(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3a(memref<2x4xi8, #map3a, 1>) +// CHECK: @f3b(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3b(memref<2x4xi8, #map3b, 1>) +// CHECK: @f3c(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3c(memref<2x4xi8, #map3c, 1>) +// CHECK: @f3d(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3d(memref<2x4xi8, #map3d, 1>) +// CHECK: @f3e(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3e(memref<2x4xi8, #map3e, 1>) +// CHECK: @f3f(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3f(memref<2x4xi8, #map3f, 1>) +// CHECK: @f3g(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3g(memref<2x4xi8, #map3g, 1>) +// CHECK: @f3h(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3h(memref<2x4xi8, #map3h, 1>) +// CHECK: @f3i(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3i(memref<2x4xi8, #map3i, 1>) +// CHECK: @f3j(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3j(memref<2x4xi8, #map3j, 1>) +// CHECK: @f3k(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3k(memref<2x4xi8, #map3k, 1>) +// CHECK: @f3l(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f3l(memref<2x4xi8, #map3l, 1>) -// CHECK: func @f4(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f4(memref<2x4xi8, #map4, 1>) +// CHECK: @f4(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f4(memref<2x4xi8, #map4, 1>) -// CHECK: func @f5(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f5(memref<2x4xi8, #map5, 1>) +// CHECK: @f5(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f5(memref<2x4xi8, #map5, 1>) -// CHECK: func @f6(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f6(memref<2x4xi8, #map6, 1>) +// CHECK: @f6(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f6(memref<2x4xi8, #map6, 1>) -// CHECK: func @f7(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f7(memref<2x4xi8, #map7, 1>) +// CHECK: @f7(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f7(memref<2x4xi8, #map7, 1>) -// CHECK: func @f8(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f8(memref<2x4xi8, #map8, 1>) +// CHECK: @f8(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f8(memref<2x4xi8, #map8, 1>) -// CHECK: func @f9(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f9(memref<2x4xi8, #map9, 1>) +// CHECK: @f9(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f9(memref<2x4xi8, #map9, 1>) -// CHECK: func @f10(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f10(memref<2x4xi8, #map10, 1>) +// CHECK: @f10(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f10(memref<2x4xi8, #map10, 1>) -// CHECK: func @f11(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f11(memref<2x4xi8, #map11, 1>) +// CHECK: @f11(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f11(memref<2x4xi8, #map11, 1>) -// CHECK: func @f12(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f12(memref<2x4xi8, #map12, 1>) +// CHECK: @f12(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f12(memref<2x4xi8, #map12, 1>) -// CHECK: func @f13(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f13(memref<2x4xi8, #map13, 1>) +// CHECK: @f13(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f13(memref<2x4xi8, #map13, 1>) -// CHECK: func @f14(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f14(memref<2x4xi8, #map14, 1>) +// CHECK: @f14(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f14(memref<2x4xi8, #map14, 1>) -// CHECK: func @f15(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f15(memref<2x4xi8, #map15, 1>) +// CHECK: @f15(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f15(memref<2x4xi8, #map15, 1>) -// CHECK: func @f16(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f16(memref<2x4xi8, #map16, 1>) +// CHECK: @f16(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f16(memref<2x4xi8, #map16, 1>) -// CHECK: func @f17(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f17(memref<2x4xi8, #map17, 1>) +// CHECK: @f17(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f17(memref<2x4xi8, #map17, 1>) -// CHECK: func @f19(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f19(memref<2x4xi8, #map19, 1>) +// CHECK: @f19(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f19(memref<2x4xi8, #map19, 1>) -// CHECK: func @f20(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f20(memref<2x4xi8, #map20, 1>) +// CHECK: @f20(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f20(memref<2x4xi8, #map20, 1>) -// CHECK: func @f18(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f18(memref<2x4xi8, #map18, 1>) +// CHECK: @f18(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f18(memref<2x4xi8, #map18, 1>) -// CHECK: func @f21(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f21(memref<2x4xi8, #map21, 1>) +// CHECK: @f21(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f21(memref<2x4xi8, #map21, 1>) -// CHECK: func @f22(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f22(memref<2x4xi8, #map22, 1>) +// CHECK: @f22(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f22(memref<2x4xi8, #map22, 1>) -// CHECK: func @f23(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f23(memref<2x4xi8, #map23, 1>) +// CHECK: @f23(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f23(memref<2x4xi8, #map23, 1>) -// CHECK: func @f24(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f24(memref<2x4xi8, #map24, 1>) +// CHECK: @f24(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f24(memref<2x4xi8, #map24, 1>) -// CHECK: func @f25(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f25(memref<2x4xi8, #map25, 1>) +// CHECK: @f25(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f25(memref<2x4xi8, #map25, 1>) -// CHECK: func @f26(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f26(memref<2x4xi8, #map26, 1>) +// CHECK: @f26(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f26(memref<2x4xi8, #map26, 1>) -// CHECK: func @f29(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f29(memref<2x4xi8, #map29, 1>) +// CHECK: @f29(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f29(memref<2x4xi8, #map29, 1>) -// CHECK: func @f30(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f30(memref<2x4xi8, #map30, 1>) +// CHECK: @f30(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f30(memref<2x4xi8, #map30, 1>) -// CHECK: func @f32(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f32(memref<2x4xi8, #map32, 1>) +// CHECK: @f32(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f32(memref<2x4xi8, #map32, 1>) -// CHECK: func @f33(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f33(memref<2x4xi8, #map33, 1>) +// CHECK: @f33(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f33(memref<2x4xi8, #map33, 1>) -// CHECK: func @f34(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f34(memref<2x4xi8, #map34, 1>) +// CHECK: @f34(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f34(memref<2x4xi8, #map34, 1>) -// CHECK: func @f35(memref<2x4x4xi8, #map{{[0-9]+}}, 1>) -func @f35(memref<2x4x4xi8, #map35, 1>) +// CHECK: @f35(memref<2x4x4xi8, #map{{[0-9]+}}, 1>) +func private @f35(memref<2x4x4xi8, #map35, 1>) -// CHECK: func @f36(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f36(memref<2x4xi8, #map36, 1>) +// CHECK: @f36(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f36(memref<2x4xi8, #map36, 1>) -// CHECK: func @f37(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f37(memref<2x4xi8, #map37, 1>) +// CHECK: @f37(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f37(memref<2x4xi8, #map37, 1>) -// CHECK: func @f38(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f38(memref<2x4xi8, #map38, 1>) +// CHECK: @f38(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f38(memref<2x4xi8, #map38, 1>) -// CHECK: func @f39(memref<2x4xi8, #map{{[0-9]+}}, 1>) -func @f39(memref<2x4xi8, #map39, 1>) +// CHECK: @f39(memref<2x4xi8, #map{{[0-9]+}}, 1>) +func private @f39(memref<2x4xi8, #map39, 1>) -// CHECK: func @f43(memref<2x4xi8, #map{{[0-9]+}}>) -func @f43(memref<2x4xi8, #map43>) +// CHECK: @f43(memref<2x4xi8, #map{{[0-9]+}}>) +func private @f43(memref<2x4xi8, #map43>) -// CHECK: func @f44(memref<2x4xi8, #map{{[0-9]+}}>) -func @f44(memref<2x4xi8, #map44>) +// CHECK: @f44(memref<2x4xi8, #map{{[0-9]+}}>) +func private @f44(memref<2x4xi8, #map44>) -// CHECK: func @f45(memref<100x100x100xi8, #map{{[0-9]+}}>) -func @f45(memref<100x100x100xi8, #map45>) +// CHECK: @f45(memref<100x100x100xi8, #map{{[0-9]+}}>) +func private @f45(memref<100x100x100xi8, #map45>) -// CHECK: func @f46(memref<100x100x100xi8, #map{{[0-9]+}}>) -func @f46(memref<100x100x100xi8, #map46>) +// CHECK: @f46(memref<100x100x100xi8, #map{{[0-9]+}}>) +func private @f46(memref<100x100x100xi8, #map46>) -// CHECK: func @f47(memref<100x100x100xi8, #map{{[0-9]+}}>) -func @f47(memref<100x100x100xi8, #map47>) +// CHECK: @f47(memref<100x100x100xi8, #map{{[0-9]+}}>) +func private @f47(memref<100x100x100xi8, #map47>) -// CHECK: func @f48(memref<100x100x100xi8, #map{{[0-9]+}}>) -func @f48(memref<100x100x100xi8, #map48>) +// CHECK: @f48(memref<100x100x100xi8, #map{{[0-9]+}}>) +func private @f48(memref<100x100x100xi8, #map48>) -// CHECK: func @f49(memref<100x100xi8, #map{{[0-9]+}}>) -func @f49(memref<100x100xi8, #map49>) +// CHECK: @f49(memref<100x100xi8, #map{{[0-9]+}}>) +func private @f49(memref<100x100xi8, #map49>) -// CHECK: func @f50(memref<100x100xi8, #map{{[0-9]+}}>) -func @f50(memref<100x100xi8, #map50>) +// CHECK: @f50(memref<100x100xi8, #map{{[0-9]+}}>) +func private @f50(memref<100x100xi8, #map50>) -// CHECK: func @f51(memref<1xi8, #map{{[0-9]+}}>) -func @f51(memref<1xi8, #map51>) +// CHECK: @f51(memref<1xi8, #map{{[0-9]+}}>) +func private @f51(memref<1xi8, #map51>) -// CHECK: func @f52(memref<1xi8, #map{{[0-9]+}}>) -func @f52(memref<1xi8, #map52>) +// CHECK: @f52(memref<1xi8, #map{{[0-9]+}}>) +func private @f52(memref<1xi8, #map52>) -// CHECK: func @f53(memref<1xi8, #map{{[0-9]+}}>) -func @f53(memref<1xi8, #map53>) +// CHECK: @f53(memref<1xi8, #map{{[0-9]+}}>) +func private @f53(memref<1xi8, #map53>) -// CHECK: func @f54(memref<10xi32, #map{{[0-9]+}}>) -func @f54(memref<10xi32, #map54>) +// CHECK: @f54(memref<10xi32, #map{{[0-9]+}}>) +func private @f54(memref<10xi32, #map54>) // CHECK: "foo.op"() {map = #map{{[0-9]+}}} : () -> () "foo.op"() {map = #map55} : () -> () -// CHECK: func @f56(memref<1x1xi8, #map{{[0-9]+}}>) -func @f56(memref<1x1xi8, #map56>) +// CHECK: @f56(memref<1x1xi8, #map{{[0-9]+}}>) +func private @f56(memref<1x1xi8, #map56>) // CHECK: "f57"() {map = #map{{[0-9]+}}} : () -> () "f57"() {map = #map57} : () -> () diff --git a/mlir/test/IR/core-ops.mlir b/mlir/test/IR/core-ops.mlir --- a/mlir/test/IR/core-ops.mlir +++ b/mlir/test/IR/core-ops.mlir @@ -748,7 +748,7 @@ // Check that unranked memrefs with non-default memory space roundtrip // properly. // CHECK-LABEL: @unranked_memref_roundtrip(memref<*xf32, 4>) -func @unranked_memref_roundtrip(memref<*xf32, 4>) +func private @unranked_memref_roundtrip(memref<*xf32, 4>) // CHECK-LABEL: func @memref_view(%arg0 func @memref_view(%arg0 : index, %arg1 : index, %arg2 : index) { diff --git a/mlir/test/IR/invalid-func-op.mlir b/mlir/test/IR/invalid-func-op.mlir --- a/mlir/test/IR/invalid-func-op.mlir +++ b/mlir/test/IR/invalid-func-op.mlir @@ -73,3 +73,8 @@ func @f(%arg0: i64) -> (i64 {test.invalid_attr}) { return %arg0 : i64 } + +// ----- + +// expected-error@+1 {{symbol declaration cannot have public visibility}} +func @invalid_public_declaration() diff --git a/mlir/test/IR/locations.mlir b/mlir/test/IR/locations.mlir --- a/mlir/test/IR/locations.mlir +++ b/mlir/test/IR/locations.mlir @@ -24,8 +24,8 @@ return %1 : i32 loc(unknown) } -// CHECK-LABEL: func @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))}) -func @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))}) +// CHECK-LABEL: func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))}) +func private @loc_attr(i1 {foo.loc_attr = loc(callsite("foo" at "mysource.cc":10:8))}) // CHECK-ALIAS: "foo.op"() : () -> () loc(#[[LOC:.*]]) "foo.op"() : () -> () loc(#loc) diff --git a/mlir/test/IR/parser.mlir b/mlir/test/IR/parser.mlir --- a/mlir/test/IR/parser.mlir +++ b/mlir/test/IR/parser.mlir @@ -46,120 +46,120 @@ // CHECK-DAG: #set{{[0-9]+}} = affine_set<(d0)[s0] : (d0 - 2 >= 0, -d0 + 4 >= 0)> -// CHECK: func @foo(i32, i64) -> f32 -func @foo(i32, i64) -> f32 +// CHECK: func private @foo(i32, i64) -> f32 +func private @foo(i32, i64) -> f32 -// CHECK: func @bar() -func @bar() -> () +// CHECK: func private @bar() +func private @bar() -> () -// CHECK: func @baz() -> (i1, index, f32) -func @baz() -> (i1, index, f32) +// CHECK: func private @baz() -> (i1, index, f32) +func private @baz() -> (i1, index, f32) -// CHECK: func @missingReturn() -func @missingReturn() +// CHECK: func private @missingReturn() +func private @missingReturn() -// CHECK: func @int_types(i1, i2, i4, i7, i87) -> (i1, index, i19) -func @int_types(i1, i2, i4, i7, i87) -> (i1, index, i19) +// CHECK: func private @int_types(i1, i2, i4, i7, i87) -> (i1, index, i19) +func private @int_types(i1, i2, i4, i7, i87) -> (i1, index, i19) -// CHECK: func @sint_types(si2, si4) -> (si7, si1023) -func @sint_types(si2, si4) -> (si7, si1023) +// CHECK: func private @sint_types(si2, si4) -> (si7, si1023) +func private @sint_types(si2, si4) -> (si7, si1023) -// CHECK: func @uint_types(ui2, ui4) -> (ui7, ui1023) -func @uint_types(ui2, ui4) -> (ui7, ui1023) +// CHECK: func private @uint_types(ui2, ui4) -> (ui7, ui1023) +func private @uint_types(ui2, ui4) -> (ui7, ui1023) -// CHECK: func @vectors(vector<1xf32>, vector<2x4xf32>) -func @vectors(vector<1 x f32>, vector<2x4xf32>) +// CHECK: func private @vectors(vector<1xf32>, vector<2x4xf32>) +func private @vectors(vector<1 x f32>, vector<2x4xf32>) -// CHECK: func @tensors(tensor<*xf32>, tensor<*xvector<2x4xf32>>, tensor<1x?x4x?x?xi32>, tensor) -func @tensors(tensor<* x f32>, tensor<* x vector<2x4xf32>>, +// CHECK: func private @tensors(tensor<*xf32>, tensor<*xvector<2x4xf32>>, tensor<1x?x4x?x?xi32>, tensor) +func private @tensors(tensor<* x f32>, tensor<* x vector<2x4xf32>>, tensor<1x?x4x?x?xi32>, tensor) -// CHECK: func @memrefs(memref<1x?x4x?x?xi32, #map{{[0-9]+}}>, memref<8xi8>) -func @memrefs(memref<1x?x4x?x?xi32, #map0>, memref<8xi8, #map1, #map1>) +// CHECK: func private @memrefs(memref<1x?x4x?x?xi32, #map{{[0-9]+}}>, memref<8xi8>) +func private @memrefs(memref<1x?x4x?x?xi32, #map0>, memref<8xi8, #map1, #map1>) // Test memref affine map compositions. -// CHECK: func @memrefs2(memref<2x4x8xi8, 1>) -func @memrefs2(memref<2x4x8xi8, #map2, 1>) +// CHECK: func private @memrefs2(memref<2x4x8xi8, 1>) +func private @memrefs2(memref<2x4x8xi8, #map2, 1>) -// CHECK: func @memrefs23(memref<2x4x8xi8, #map{{[0-9]+}}>) -func @memrefs23(memref<2x4x8xi8, #map2, #map3, 0>) +// CHECK: func private @memrefs23(memref<2x4x8xi8, #map{{[0-9]+}}>) +func private @memrefs23(memref<2x4x8xi8, #map2, #map3, 0>) -// CHECK: func @memrefs234(memref<2x4x8xi8, #map{{[0-9]+}}, #map{{[0-9]+}}, 3>) -func @memrefs234(memref<2x4x8xi8, #map2, #map3, #map4, 3>) +// CHECK: func private @memrefs234(memref<2x4x8xi8, #map{{[0-9]+}}, #map{{[0-9]+}}, 3>) +func private @memrefs234(memref<2x4x8xi8, #map2, #map3, #map4, 3>) // Test memref inline affine map compositions, minding that identity maps are removed. -// CHECK: func @memrefs3(memref<2x4x8xi8>) -func @memrefs3(memref<2x4x8xi8, affine_map<(d0, d1, d2) -> (d0, d1, d2)>>) +// CHECK: func private @memrefs3(memref<2x4x8xi8>) +func private @memrefs3(memref<2x4x8xi8, affine_map<(d0, d1, d2) -> (d0, d1, d2)>>) -// CHECK: func @memrefs33(memref<2x4x8xi8, #map{{[0-9]+}}, 1>) -func @memrefs33(memref<2x4x8xi8, affine_map<(d0, d1, d2) -> (d0, d1, d2)>, affine_map<(d0, d1, d2) -> (d1, d0, d2)>, 1>) +// CHECK: func private @memrefs33(memref<2x4x8xi8, #map{{[0-9]+}}, 1>) +func private @memrefs33(memref<2x4x8xi8, affine_map<(d0, d1, d2) -> (d0, d1, d2)>, affine_map<(d0, d1, d2) -> (d1, d0, d2)>, 1>) -// CHECK: func @memrefs_drop_triv_id_inline(memref<2xi8>) -func @memrefs_drop_triv_id_inline(memref<2xi8, affine_map<(d0) -> (d0)>>) +// CHECK: func private @memrefs_drop_triv_id_inline(memref<2xi8>) +func private @memrefs_drop_triv_id_inline(memref<2xi8, affine_map<(d0) -> (d0)>>) -// CHECK: func @memrefs_drop_triv_id_inline0(memref<2xi8>) -func @memrefs_drop_triv_id_inline0(memref<2xi8, affine_map<(d0) -> (d0)>, 0>) +// CHECK: func private @memrefs_drop_triv_id_inline0(memref<2xi8>) +func private @memrefs_drop_triv_id_inline0(memref<2xi8, affine_map<(d0) -> (d0)>, 0>) -// CHECK: func @memrefs_drop_triv_id_inline1(memref<2xi8, 1>) -func @memrefs_drop_triv_id_inline1(memref<2xi8, affine_map<(d0) -> (d0)>, 1>) +// CHECK: func private @memrefs_drop_triv_id_inline1(memref<2xi8, 1>) +func private @memrefs_drop_triv_id_inline1(memref<2xi8, affine_map<(d0) -> (d0)>, 1>) // Identity maps should be dropped from the composition, but not the pair of // "interchange" maps that, if composed, would be also an identity. -// CHECK: func @memrefs_drop_triv_id_composition(memref<2x2xi8, #map{{[0-9]+}}, #map{{[0-9]+}}>) -func @memrefs_drop_triv_id_composition(memref<2x2xi8, +// CHECK: func private @memrefs_drop_triv_id_composition(memref<2x2xi8, #map{{[0-9]+}}, #map{{[0-9]+}}>) +func private @memrefs_drop_triv_id_composition(memref<2x2xi8, affine_map<(d0, d1) -> (d1, d0)>, affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d1, d0)>, affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d0, d1)>>) -// CHECK: func @memrefs_drop_triv_id_trailing(memref<2x2xi8, #map{{[0-9]+}}>) -func @memrefs_drop_triv_id_trailing(memref<2x2xi8, affine_map<(d0, d1) -> (d1, d0)>, +// CHECK: func private @memrefs_drop_triv_id_trailing(memref<2x2xi8, #map{{[0-9]+}}>) +func private @memrefs_drop_triv_id_trailing(memref<2x2xi8, affine_map<(d0, d1) -> (d1, d0)>, affine_map<(d0, d1) -> (d0, d1)>>) -// CHECK: func @memrefs_drop_triv_id_middle(memref<2x2xi8, #map{{[0-9]+}}, #map{{[0-9]+}}>) -func @memrefs_drop_triv_id_middle(memref<2x2xi8, +// CHECK: func private @memrefs_drop_triv_id_middle(memref<2x2xi8, #map{{[0-9]+}}, #map{{[0-9]+}}>) +func private @memrefs_drop_triv_id_middle(memref<2x2xi8, affine_map<(d0, d1) -> (d0, d1 + 1)>, affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d0 + 1, d1)>>) -// CHECK: func @memrefs_drop_triv_id_multiple(memref<2xi8>) -func @memrefs_drop_triv_id_multiple(memref<2xi8, affine_map<(d0) -> (d0)>, affine_map<(d0) -> (d0)>>) +// CHECK: func private @memrefs_drop_triv_id_multiple(memref<2xi8>) +func private @memrefs_drop_triv_id_multiple(memref<2xi8, affine_map<(d0) -> (d0)>, affine_map<(d0) -> (d0)>>) // These maps appeared before, so they must be uniqued and hoisted to the beginning. // Identity map should be removed. -// CHECK: func @memrefs_compose_with_id(memref<2x2xi8, #map{{[0-9]+}}>) -func @memrefs_compose_with_id(memref<2x2xi8, affine_map<(d0, d1) -> (d0, d1)>, +// CHECK: func private @memrefs_compose_with_id(memref<2x2xi8, #map{{[0-9]+}}>) +func private @memrefs_compose_with_id(memref<2x2xi8, affine_map<(d0, d1) -> (d0, d1)>, affine_map<(d0, d1) -> (d1, d0)>>) -// CHECK: func @complex_types(complex) -> complex -func @complex_types(complex) -> complex +// CHECK: func private @complex_types(complex) -> complex +func private @complex_types(complex) -> complex -// CHECK: func @memref_with_index_elems(memref<1x?xindex>) -func @memref_with_index_elems(memref<1x?xindex>) +// CHECK: func private @memref_with_index_elems(memref<1x?xindex>) +func private @memref_with_index_elems(memref<1x?xindex>) -// CHECK: func @memref_with_complex_elems(memref<1x?xcomplex>) -func @memref_with_complex_elems(memref<1x?xcomplex>) +// CHECK: func private @memref_with_complex_elems(memref<1x?xcomplex>) +func private @memref_with_complex_elems(memref<1x?xcomplex>) -// CHECK: func @memref_with_vector_elems(memref<1x?xvector<10xf32>>) -func @memref_with_vector_elems(memref<1x?xvector<10xf32>>) +// CHECK: func private @memref_with_vector_elems(memref<1x?xvector<10xf32>>) +func private @memref_with_vector_elems(memref<1x?xvector<10xf32>>) -// CHECK: func @unranked_memref_with_complex_elems(memref<*xcomplex>) -func @unranked_memref_with_complex_elems(memref<*xcomplex>) +// CHECK: func private @unranked_memref_with_complex_elems(memref<*xcomplex>) +func private @unranked_memref_with_complex_elems(memref<*xcomplex>) -// CHECK: func @unranked_memref_with_index_elems(memref<*xindex>) -func @unranked_memref_with_index_elems(memref<*xindex>) +// CHECK: func private @unranked_memref_with_index_elems(memref<*xindex>) +func private @unranked_memref_with_index_elems(memref<*xindex>) -// CHECK: func @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>) -func @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>) +// CHECK: func private @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>) +func private @unranked_memref_with_vector_elems(memref<*xvector<10xf32>>) -// CHECK: func @functions((memref<1x?x4x?x?xi32, #map0>, memref<8xi8>) -> (), () -> ()) -func @functions((memref<1x?x4x?x?xi32, #map0, 0>, memref<8xi8, #map1, 0>) -> (), ()->()) +// CHECK: func private @functions((memref<1x?x4x?x?xi32, #map0>, memref<8xi8>) -> (), () -> ()) +func private @functions((memref<1x?x4x?x?xi32, #map0, 0>, memref<8xi8, #map1, 0>) -> (), ()->()) // CHECK-LABEL: func @simpleCFG(%{{.*}}: i32, %{{.*}}: f32) -> i1 { func @simpleCFG(%arg0: i32, %f: f32) -> i1 { @@ -565,17 +565,17 @@ return } -// CHECK-LABEL: func @externalfuncattr -func @externalfuncattr() -> () +// CHECK-LABEL: func private @externalfuncattr +func private @externalfuncattr() -> () // CHECK: attributes {dialect.a = "a\22quoted\22string", dialect.b = 4.000000e+00 : f64, dialect.c = tensor<*xf32>} attributes {dialect.a = "a\"quoted\"string", dialect.b = 4.0, dialect.c = tensor<*xf32>} -// CHECK-LABEL: func @funcattrempty -func @funcattrempty() -> () +// CHECK-LABEL: func private @funcattrempty +func private @funcattrempty() -> () attributes {} -// CHECK-LABEL: func @funcattr -func @funcattr() -> () +// CHECK-LABEL: func private @funcattr +func private @funcattr() -> () // CHECK: attributes {dialect.a = "a\22quoted\22string", dialect.b = 4.000000e+00 : f64, dialect.c = tensor<*xf32>} attributes {dialect.a = "a\"quoted\"string", dialect.b = 4.0, dialect.c = tensor<*xf32>} { ^bb0: @@ -888,11 +888,11 @@ return } -// CHECK-LABEL: func @_valid.function$name -func @_valid.function$name() +// CHECK-LABEL: func private @_valid.function$name +func private @_valid.function$name() -// CHECK-LABEL: func @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32) -func @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32) +// CHECK-LABEL: func private @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32) +func private @external_func_arg_attrs(i32, i1 {dialect.attr = 10 : i64}, i32) // CHECK-LABEL: func @func_arg_attrs(%{{.*}}: i1 {dialect.attr = 10 : i64}) func @func_arg_attrs(%arg0: i1 {dialect.attr = 10 : i64}) { @@ -904,17 +904,17 @@ return %arg0 : f32 } -// CHECK-LABEL: func @empty_tuple(tuple<>) -func @empty_tuple(tuple<>) +// CHECK-LABEL: func private @empty_tuple(tuple<>) +func private @empty_tuple(tuple<>) -// CHECK-LABEL: func @tuple_single_element(tuple) -func @tuple_single_element(tuple) +// CHECK-LABEL: func private @tuple_single_element(tuple) +func private @tuple_single_element(tuple) -// CHECK-LABEL: func @tuple_multi_element(tuple) -func @tuple_multi_element(tuple) +// CHECK-LABEL: func private @tuple_multi_element(tuple) +func private @tuple_multi_element(tuple) -// CHECK-LABEL: func @tuple_nested(tuple>>) -func @tuple_nested(tuple>>) +// CHECK-LABEL: func private @tuple_nested(tuple>>) +func private @tuple_nested(tuple>>) // CHECK-LABEL: func @pretty_form_multi_result func @pretty_form_multi_result() -> (i16, i16) { @@ -1168,11 +1168,11 @@ return } -// CHECK-LABEL: func @ptr_to_function() -> !unreg.ptr<() -> ()> -func @ptr_to_function() -> !unreg.ptr<() -> ()> +// CHECK-LABEL: func private @ptr_to_function() -> !unreg.ptr<() -> ()> +func private @ptr_to_function() -> !unreg.ptr<() -> ()> -// CHECK-LABEL: func @escaped_string_char(i1 {foo.value = "\0A"}) -func @escaped_string_char(i1 {foo.value = "\n"}) +// CHECK-LABEL: func private @escaped_string_char(i1 {foo.value = "\0A"}) +func private @escaped_string_char(i1 {foo.value = "\n"}) // CHECK-LABEL: func @wrapped_keyword_test func @wrapped_keyword_test() { @@ -1188,13 +1188,13 @@ return } -// CHECK-LABEL: func @string_attr_name +// CHECK-LABEL: func private @string_attr_name // CHECK-SAME: {"0 . 0", nested = {"0 . 0"}} -func @string_attr_name() attributes {"0 . 0", nested = {"0 . 0"}} +func private @string_attr_name() attributes {"0 . 0", nested = {"0 . 0"}} -// CHECK-LABEL: func @nested_reference +// CHECK-LABEL: func private @nested_reference // CHECK: ref = @some_symbol::@some_nested_symbol -func @nested_reference() attributes {test.ref = @some_symbol::@some_nested_symbol } +func private @nested_reference() attributes {test.ref = @some_symbol::@some_nested_symbol } // CHECK-LABEL: func @custom_asm_names func @custom_asm_names() -> (i32, i32, i32, i32, i32, i32, i32) { diff --git a/mlir/test/IR/test-func-erase-result.mlir b/mlir/test/IR/test-func-erase-result.mlir --- a/mlir/test/IR/test-func-erase-result.mlir +++ b/mlir/test/IR/test-func-erase-result.mlir @@ -1,32 +1,32 @@ // RUN: mlir-opt %s -test-func-erase-result -split-input-file | FileCheck %s -// CHECK: func @f(){{$}} +// CHECK: func private @f(){{$}} // CHECK-NOT: attributes{{.*}}result -func @f() -> (f32 {test.erase_this_result}) +func private @f() -> (f32 {test.erase_this_result}) // ----- -// CHECK: func @f() -> (f32 {test.A}) +// CHECK: func private @f() -> (f32 {test.A}) // CHECK-NOT: attributes{{.*}}result -func @f() -> ( +func private @f() -> ( f32 {test.erase_this_result}, f32 {test.A} ) // ----- -// CHECK: func @f() -> (f32 {test.A}) +// CHECK: func private @f() -> (f32 {test.A}) // CHECK-NOT: attributes{{.*}}result -func @f() -> ( +func private @f() -> ( f32 {test.A}, f32 {test.erase_this_result} ) // ----- -// CHECK: func @f() -> (f32 {test.A}, f32 {test.B}) +// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}) // CHECK-NOT: attributes{{.*}}result -func @f() -> ( +func private @f() -> ( f32 {test.A}, f32 {test.erase_this_result}, f32 {test.B} @@ -34,9 +34,9 @@ // ----- -// CHECK: func @f() -> (f32 {test.A}, f32 {test.B}) +// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}) // CHECK-NOT: attributes{{.*}}result -func @f() -> ( +func private @f() -> ( f32 {test.A}, f32 {test.erase_this_result}, f32 {test.erase_this_result}, @@ -45,9 +45,9 @@ // ----- -// CHECK: func @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C}) +// CHECK: func private @f() -> (f32 {test.A}, f32 {test.B}, f32 {test.C}) // CHECK-NOT: attributes{{.*}}result -func @f() -> ( +func private @f() -> ( f32 {test.A}, f32 {test.erase_this_result}, f32 {test.B}, @@ -57,9 +57,9 @@ // ----- -// CHECK: func @f() -> (tensor<1xf32>, tensor<2xf32>, tensor<3xf32>) +// CHECK: func private @f() -> (tensor<1xf32>, tensor<2xf32>, tensor<3xf32>) // CHECK-NOT: attributes{{.*}}result -func @f() -> ( +func private @f() -> ( tensor<1xf32>, f32 {test.erase_this_result}, tensor<2xf32>, diff --git a/mlir/test/IR/test-func-set-type.mlir b/mlir/test/IR/test-func-set-type.mlir --- a/mlir/test/IR/test-func-set-type.mlir +++ b/mlir/test/IR/test-func-set-type.mlir @@ -8,18 +8,18 @@ // Test case: The setType call needs to erase some arg attrs. -// CHECK: func @erase_arg(f32 {test.A}) +// CHECK: func private @erase_arg(f32 {test.A}) // CHECK-NOT: attributes{{.*arg[0-9]}} -func @t(f32) -func @erase_arg(%arg0: f32 {test.A}, %arg1: f32 {test.B}) +func private @t(f32) +func private @erase_arg(%arg0: f32 {test.A}, %arg1: f32 {test.B}) attributes {test.set_type_from = @t} // ----- // Test case: The setType call needs to erase some result attrs. -// CHECK: func @erase_result() -> (f32 {test.A}) +// CHECK: func private @erase_result() -> (f32 {test.A}) // CHECK-NOT: attributes{{.*result[0-9]}} -func @t() -> (f32) -func @erase_result() -> (f32 {test.A}, f32 {test.B}) +func private @t() -> (f32) +func private @erase_result() -> (f32 {test.A}, f32 {test.B}) attributes {test.set_type_from = @t} diff --git a/mlir/test/IR/test-symbol-rauw.mlir b/mlir/test/IR/test-symbol-rauw.mlir --- a/mlir/test/IR/test-symbol-rauw.mlir +++ b/mlir/test/IR/test-symbol-rauw.mlir @@ -5,8 +5,8 @@ // CHECK: module // CHECK-SAME: @symbol_foo module attributes {sym.outside_use = @symbol_foo } { - // CHECK: func @replaced_foo - func @symbol_foo() attributes {sym.new_name = "replaced_foo" } + // CHECK: func private @replaced_foo + func private @symbol_foo() attributes {sym.new_name = "replaced_foo" } // CHECK: func @symbol_bar // CHECK: @replaced_foo @@ -38,16 +38,16 @@ module { // CHECK: module @module_a module @module_a { - // CHECK: func @replaced_foo - func @foo() attributes {sym.new_name = "replaced_foo" } + // CHECK: func nested @replaced_foo + func nested @foo() attributes {sym.new_name = "replaced_foo" } } // CHECK: module @replaced_module_b module @module_b attributes {sym.new_name = "replaced_module_b"} { // CHECK: module @replaced_module_c module @module_c attributes {sym.new_name = "replaced_module_c"} { - // CHECK: func @replaced_foo - func @foo() attributes {sym.new_name = "replaced_foo" } + // CHECK: func nested @replaced_foo + func nested @foo() attributes {sym.new_name = "replaced_foo" } } } @@ -67,8 +67,8 @@ // Check that the replacement fails for potentially unknown symbol tables. module { - // CHECK: func @failed_repl - func @failed_repl() attributes {sym.new_name = "replaced_name" } + // CHECK: func private @failed_repl + func private @failed_repl() attributes {sym.new_name = "replaced_name" } "foo.possibly_unknown_symbol_table"() ({ }) : () -> () diff --git a/mlir/test/IR/test-symbol-uses.mlir b/mlir/test/IR/test-symbol-uses.mlir --- a/mlir/test/IR/test-symbol-uses.mlir +++ b/mlir/test/IR/test-symbol-uses.mlir @@ -5,7 +5,7 @@ // expected-remark@below {{symbol_removable function successfully erased}} module attributes {sym.outside_use = @symbol_foo } { // expected-remark@+1 {{symbol has 2 uses}} - func @symbol_foo() + func private @symbol_foo() // expected-remark@below {{symbol has no uses}} // expected-remark@below {{found use of symbol : @symbol_foo}} @@ -20,10 +20,10 @@ } // expected-remark@below {{symbol has no uses}} - func @symbol_removable() + func private @symbol_removable() // expected-remark@+1 {{symbol has 1 use}} - func @symbol_baz() + func private @symbol_baz() // expected-remark@+1 {{found use of symbol : @symbol_baz}} module attributes {test.reference = @symbol_baz} { @@ -40,7 +40,7 @@ // expected-remark@+1 {{symbol has 1 uses}} module @module_c { // expected-remark@+1 {{symbol has 1 uses}} - func @foo() + func nested @foo() } } diff --git a/mlir/test/IR/traits.mlir b/mlir/test/IR/traits.mlir --- a/mlir/test/IR/traits.mlir +++ b/mlir/test/IR/traits.mlir @@ -344,11 +344,11 @@ // Test that operation with the SymbolTable Trait define a new symbol scope. "test.symbol_scope"() ({ - func @foo() { + func private @foo() { } "test.finish" () : () -> () }) : () -> () -func @foo() { +func private @foo() { } // ----- diff --git a/mlir/test/Pass/dynamic-pipeline-fail-on-parent.mlir b/mlir/test/Pass/dynamic-pipeline-fail-on-parent.mlir --- a/mlir/test/Pass/dynamic-pipeline-fail-on-parent.mlir +++ b/mlir/test/Pass/dynamic-pipeline-fail-on-parent.mlir @@ -6,6 +6,6 @@ module { module @inner_mod1 { "test.symbol"() {sym_name = "foo"} : () -> () - func @bar() + func private @bar() } } diff --git a/mlir/test/Pass/dynamic-pipeline-nested.mlir b/mlir/test/Pass/dynamic-pipeline-nested.mlir --- a/mlir/test/Pass/dynamic-pipeline-nested.mlir +++ b/mlir/test/Pass/dynamic-pipeline-nested.mlir @@ -20,9 +20,9 @@ // CHECK: Dump Before CSE // NOTNESTED-NEXT: @inner_mod1 // NESTED-NEXT: @foo - func @foo() + func private @foo() // Only in the nested case we have a second run of the pass here. // NESTED: Dump Before CSE // NESTED-NEXT: @baz - func @baz() + func private @baz() } diff --git a/mlir/test/Transforms/buffer-results-to-out-params.mlir b/mlir/test/Transforms/buffer-results-to-out-params.mlir --- a/mlir/test/Transforms/buffer-results-to-out-params.mlir +++ b/mlir/test/Transforms/buffer-results-to-out-params.mlir @@ -47,17 +47,17 @@ return %0, %1, %2 : i1, memref, i32 } -// CHECK: func @external_function(memref) -func @external_function() -> (memref) -// CHECK: func @result_attrs(memref {test.some_attr}) -func @result_attrs() -> (memref {test.some_attr}) -// CHECK: func @mixed_result_attrs(memref<1xf32>, memref<2xf32> {test.some_attr}, memref<3xf32>) -func @mixed_result_attrs() -> (memref<1xf32>, memref<2xf32> {test.some_attr}, memref<3xf32>) +// CHECK: func private @external_function(memref) +func private @external_function() -> (memref) +// CHECK: func private @result_attrs(memref {test.some_attr}) +func private @result_attrs() -> (memref {test.some_attr}) +// CHECK: func private @mixed_result_attrs(memref<1xf32>, memref<2xf32> {test.some_attr}, memref<3xf32>) +func private @mixed_result_attrs() -> (memref<1xf32>, memref<2xf32> {test.some_attr}, memref<3xf32>) // ----- -// CHECK-LABEL: func @callee(memref<1xf32>) -func @callee() -> memref<1xf32> +// CHECK-LABEL: func private @callee(memref<1xf32>) +func private @callee() -> memref<1xf32> // CHECK-LABEL: func @call_basic() { // CHECK: %[[OUTPARAM:.*]] = alloc() : memref<1xf32> @@ -73,8 +73,8 @@ // ----- -// CHECK-LABEL: func @callee(memref<1xf32>, memref<2xf32>) -func @callee() -> (memref<1xf32>, memref<2xf32>) +// CHECK-LABEL: func private @callee(memref<1xf32>, memref<2xf32>) +func private @callee() -> (memref<1xf32>, memref<2xf32>) // CHECK-LABEL: func @call_multiple_result() { // CHECK: %[[RESULT0:.*]] = alloc() : memref<1xf32> @@ -89,8 +89,8 @@ // ----- -// CHECK-LABEL: func @callee(memref<1xf32>) -> (i1, i32) -func @callee() -> (i1, memref<1xf32>, i32) +// CHECK-LABEL: func private @callee(memref<1xf32>) -> (i1, i32) +func private @callee() -> (i1, memref<1xf32>, i32) // CHECK-LABEL: func @call_non_memref_result() { // CHECK: %[[RESULT0:.*]] = alloc() : memref<1xf32> @@ -104,7 +104,7 @@ // ----- -func @callee() -> (memref) +func private @callee() -> (memref) func @call_non_memref_result() { // expected-error @+1 {{cannot create out param for dynamically shaped result}} diff --git a/mlir/test/Transforms/inlining.mlir b/mlir/test/Transforms/inlining.mlir --- a/mlir/test/Transforms/inlining.mlir +++ b/mlir/test/Transforms/inlining.mlir @@ -64,8 +64,8 @@ } -// Check that external functions are not inlined. -func @func_external() +// Check that external function declarations are not inlined. +func private @func_external() // CHECK-LABEL: func @no_inline_external func @no_inline_external() { diff --git a/mlir/test/Transforms/normalize-memrefs.mlir b/mlir/test/Transforms/normalize-memrefs.mlir --- a/mlir/test/Transforms/normalize-memrefs.mlir +++ b/mlir/test/Transforms/normalize-memrefs.mlir @@ -294,13 +294,13 @@ } // Test case set #7: Check normalization in case of external functions. -// CHECK-LABEL: func @external_func_A +// CHECK-LABEL: func private @external_func_A // CHECK-SAME: (memref<4x4xf64>) -func @external_func_A(memref<16xf64, #tile>) -> () +func private @external_func_A(memref<16xf64, #tile>) -> () -// CHECK-LABEL: func @external_func_B +// CHECK-LABEL: func private @external_func_B // CHECK-SAME: (memref<4x4xf64>, f64) -> memref<2x4xf64> -func @external_func_B(memref<16xf64, #tile>, f64) -> (memref<8xf64, #tile>) +func private @external_func_B(memref<16xf64, #tile>, f64) -> (memref<8xf64, #tile>) // CHECK-LABEL: func @simply_call_external() func @simply_call_external() { diff --git a/mlir/test/Transforms/sccp-callgraph.mlir b/mlir/test/Transforms/sccp-callgraph.mlir --- a/mlir/test/Transforms/sccp-callgraph.mlir +++ b/mlir/test/Transforms/sccp-callgraph.mlir @@ -204,7 +204,7 @@ return %arg_inc : i32 } -func @complex_cond() -> i1 +func private @complex_cond() -> i1 // CHECK-LABEL: func private @complex_callee( func private @complex_callee(%arg0 : i32) -> i32 { diff --git a/mlir/test/Transforms/sccp.mlir b/mlir/test/Transforms/sccp.mlir --- a/mlir/test/Transforms/sccp.mlir +++ b/mlir/test/Transforms/sccp.mlir @@ -90,7 +90,7 @@ /// Check that arguments are properly merged across loop-like control flow. -func @ext_cond_fn() -> i1 +func private @ext_cond_fn() -> i1 // CHECK-LABEL: func @simple_loop func @simple_loop(%arg0 : i32, %cond1 : i1) -> i32 { @@ -161,7 +161,7 @@ /// Check that arguments go to overdefined when loop backedges produce a /// conflicting value. -func @ext_cond_and_value_fn() -> (i1, i32) +func private @ext_cond_and_value_fn() -> (i1, i32) // CHECK-LABEL: func @simple_loop_overdefined func @simple_loop_overdefined(%arg0 : i32, %cond1 : i1) -> i32 { diff --git a/mlir/test/Transforms/test-convert-call-op.mlir b/mlir/test/Transforms/test-convert-call-op.mlir --- a/mlir/test/Transforms/test-convert-call-op.mlir +++ b/mlir/test/Transforms/test-convert-call-op.mlir @@ -1,7 +1,7 @@ // RUN: mlir-opt %s -test-convert-call-op | FileCheck %s // CHECK-LABEL: llvm.func @callee(!llvm.ptr) -> !llvm.i32 -func @callee(!test.test_type) -> i32 +func private @callee(!test.test_type) -> i32 // CHECK-NEXT: llvm.func @caller() -> !llvm.i32 func @caller() -> i32 { diff --git a/mlir/test/Transforms/test-legalizer.mlir b/mlir/test/Transforms/test-legalizer.mlir --- a/mlir/test/Transforms/test-legalizer.mlir +++ b/mlir/test/Transforms/test-legalizer.mlir @@ -16,8 +16,8 @@ return %result : i32 } -// CHECK-LABEL: func @remap_input_1_to_0() -func @remap_input_1_to_0(i16) +// CHECK-LABEL: func private @remap_input_1_to_0() +func private @remap_input_1_to_0(i16) // CHECK-LABEL: func @remap_input_1_to_1(%arg0: f64) func @remap_input_1_to_1(%arg0: i64) { diff --git a/mlir/test/Transforms/test-symbol-dce.mlir b/mlir/test/Transforms/test-symbol-dce.mlir --- a/mlir/test/Transforms/test-symbol-dce.mlir +++ b/mlir/test/Transforms/test-symbol-dce.mlir @@ -21,9 +21,6 @@ func @public_function() { "foo.return"() {uses = [@live_private_function, @live_nested_function]} : () -> () } - - // CHECK: func public @public_function_explicit - func public @public_function_explicit() } // ----- diff --git a/mlir/test/mlir-cpu-runner/async-group.mlir b/mlir/test/mlir-cpu-runner/async-group.mlir --- a/mlir/test/mlir-cpu-runner/async-group.mlir +++ b/mlir/test/mlir-cpu-runner/async-group.mlir @@ -37,4 +37,4 @@ return } -func @mlirAsyncRuntimePrintCurrentThreadId() -> () +func private @mlirAsyncRuntimePrintCurrentThreadId() -> () diff --git a/mlir/test/mlir-cpu-runner/async.mlir b/mlir/test/mlir-cpu-runner/async.mlir --- a/mlir/test/mlir-cpu-runner/async.mlir +++ b/mlir/test/mlir-cpu-runner/async.mlir @@ -79,6 +79,6 @@ return } -func @mlirAsyncRuntimePrintCurrentThreadId() -> () +func private @mlirAsyncRuntimePrintCurrentThreadId() -> () -func @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } +func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } diff --git a/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir b/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir --- a/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir +++ b/mlir/test/mlir-cpu-runner/bare_ptr_call_conv.mlir @@ -28,9 +28,9 @@ // External declarations. llvm.func @malloc(!llvm.i64) -> !llvm.ptr llvm.func @free(!llvm.ptr) -func @printF32(%arg0: f32) -func @printComma() -func @printNewline() +func private @printF32(%arg0: f32) +func private @printComma() +func private @printNewline() func @main() { diff --git a/mlir/test/mlir-cpu-runner/global_memref.mlir b/mlir/test/mlir-cpu-runner/global_memref.mlir --- a/mlir/test/mlir-cpu-runner/global_memref.mlir +++ b/mlir/test/mlir-cpu-runner/global_memref.mlir @@ -1,8 +1,8 @@ // RUN: mlir-opt %s -convert-std-to-llvm | 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 -func @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } -func @print_memref_i32(memref<*xi32>) attributes { llvm.emit_c_interface } -func @printNewline() -> () +func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } +func private @print_memref_i32(memref<*xi32>) attributes { llvm.emit_c_interface } +func private @printNewline() -> () global_memref "private" @gv0 : memref<4xf32> = dense<[0.0, 1.0, 2.0, 3.0]> func @test1DMemref() { diff --git a/mlir/test/mlir-cpu-runner/memref_reinterpret_cast.mlir b/mlir/test/mlir-cpu-runner/memref_reinterpret_cast.mlir --- a/mlir/test/mlir-cpu-runner/memref_reinterpret_cast.mlir +++ b/mlir/test/mlir-cpu-runner/memref_reinterpret_cast.mlir @@ -3,7 +3,7 @@ // RUN: -shared-libs=%mlir_runner_utils_dir/libmlir_runner_utils%shlibext,%mlir_runner_utils_dir/libmlir_c_runner_utils%shlibext \ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } +func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } func @main() -> () { %c0 = constant 0 : index diff --git a/mlir/test/mlir-cpu-runner/memref_reshape.mlir b/mlir/test/mlir-cpu-runner/memref_reshape.mlir --- a/mlir/test/mlir-cpu-runner/memref_reshape.mlir +++ b/mlir/test/mlir-cpu-runner/memref_reshape.mlir @@ -4,7 +4,7 @@ // RUN: | FileCheck %s -func @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } +func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } func @main() -> () { %c0 = constant 0 : index diff --git a/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir b/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir --- a/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir +++ b/mlir/test/mlir-cpu-runner/sgemm_naive_codegen.mlir @@ -69,6 +69,6 @@ return } -func @print_flops(f64) -func @rtclock() -> f64 -func @print_memref_f32(memref<*xf32>) +func private @print_flops(f64) +func private @rtclock() -> f64 +func private @print_memref_f32(memref<*xf32>) diff --git a/mlir/test/mlir-cpu-runner/unranked_memref.mlir b/mlir/test/mlir-cpu-runner/unranked_memref.mlir --- a/mlir/test/mlir-cpu-runner/unranked_memref.mlir +++ b/mlir/test/mlir-cpu-runner/unranked_memref.mlir @@ -70,8 +70,8 @@ return } -func @print_memref_i8(memref<*xi8>) attributes { llvm.emit_c_interface } -func @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } +func private @print_memref_i8(memref<*xi8>) attributes { llvm.emit_c_interface } +func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } func @return_two_var_memref_caller() { %0 = alloca() : memref<4x3xf32> @@ -102,8 +102,8 @@ return %0 : memref<*xf32> } -func @printU64(index) -> () -func @printNewline() -> () +func private @printU64(index) -> () +func private @printNewline() -> () func @dim_op_of_unranked() { %ranked = alloc() : memref<4x3xf32> diff --git a/mlir/test/mlir-cpu-runner/utils.mlir b/mlir/test/mlir-cpu-runner/utils.mlir --- a/mlir/test/mlir-cpu-runner/utils.mlir +++ b/mlir/test/mlir-cpu-runner/utils.mlir @@ -49,7 +49,7 @@ // PRINT-3D-NEXT: 2, 2, 4, 2, 2 // PRINT-3D-NEXT: 2, 2, 2, 2, 2 -func @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } +func private @print_memref_f32(memref<*xf32>) attributes { llvm.emit_c_interface } !vector_type_C = type vector<4x4xf32> !matrix_type_CC = type memref<1x1x!vector_type_C> @@ -70,4 +70,4 @@ // PRINT-VECTOR-SPLAT-2D: Memref base@ = {{.*}} rank = 2 offset = 0 sizes = [1, 1] strides = [1, 1] data = // PRINT-VECTOR-SPLAT-2D-NEXT: [((10, 10, 10, 10), (10, 10, 10, 10), (10, 10, 10, 10), (10, 10, 10, 10))] -func @print_memref_vector_4x4xf32(memref) attributes { llvm.emit_c_interface } +func private @print_memref_vector_4x4xf32(memref) attributes { llvm.emit_c_interface } diff --git a/mlir/test/mlir-cuda-runner/all-reduce-and.mlir b/mlir/test/mlir-cuda-runner/all-reduce-and.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-and.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-and.mlir @@ -58,5 +58,5 @@ return } -func @print_memref_i32(memref<*xi32>) +func private @print_memref_i32(memref<*xi32>) diff --git a/mlir/test/mlir-cuda-runner/all-reduce-max.mlir b/mlir/test/mlir-cuda-runner/all-reduce-max.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-max.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-max.mlir @@ -58,5 +58,5 @@ return } -func @print_memref_i32(memref<*xi32>) +func private @print_memref_i32(memref<*xi32>) diff --git a/mlir/test/mlir-cuda-runner/all-reduce-min.mlir b/mlir/test/mlir-cuda-runner/all-reduce-min.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-min.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-min.mlir @@ -58,5 +58,5 @@ return } -func @print_memref_i32(memref<*xi32>) +func private @print_memref_i32(memref<*xi32>) diff --git a/mlir/test/mlir-cuda-runner/all-reduce-op.mlir b/mlir/test/mlir-cuda-runner/all-reduce-op.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-op.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-op.mlir @@ -28,4 +28,4 @@ return } -func @print_memref_f32(%ptr : memref<*xf32>) +func private @print_memref_f32(%ptr : memref<*xf32>) diff --git a/mlir/test/mlir-cuda-runner/all-reduce-or.mlir b/mlir/test/mlir-cuda-runner/all-reduce-or.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-or.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-or.mlir @@ -58,5 +58,5 @@ return } -func @print_memref_i32(memref<*xi32>) +func private @print_memref_i32(memref<*xi32>) diff --git a/mlir/test/mlir-cuda-runner/all-reduce-region.mlir b/mlir/test/mlir-cuda-runner/all-reduce-region.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-region.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-region.mlir @@ -25,4 +25,4 @@ return } -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) diff --git a/mlir/test/mlir-cuda-runner/all-reduce-xor.mlir b/mlir/test/mlir-cuda-runner/all-reduce-xor.mlir --- a/mlir/test/mlir-cuda-runner/all-reduce-xor.mlir +++ b/mlir/test/mlir-cuda-runner/all-reduce-xor.mlir @@ -58,5 +58,5 @@ return } -func @print_memref_i32(memref<*xi32>) +func private @print_memref_i32(memref<*xi32>) diff --git a/mlir/test/mlir-cuda-runner/gpu-to-cubin.mlir b/mlir/test/mlir-cuda-runner/gpu-to-cubin.mlir --- a/mlir/test/mlir-cuda-runner/gpu-to-cubin.mlir +++ b/mlir/test/mlir-cuda-runner/gpu-to-cubin.mlir @@ -26,4 +26,4 @@ return } -func @print_memref_f32(%ptr : memref<*xf32>) +func private @print_memref_f32(%ptr : memref<*xf32>) diff --git a/mlir/test/mlir-cuda-runner/multiple-all-reduce.mlir b/mlir/test/mlir-cuda-runner/multiple-all-reduce.mlir --- a/mlir/test/mlir-cuda-runner/multiple-all-reduce.mlir +++ b/mlir/test/mlir-cuda-runner/multiple-all-reduce.mlir @@ -66,4 +66,4 @@ return } -func @print_memref_f32(memref<*xf32>) +func private @print_memref_f32(memref<*xf32>) diff --git a/mlir/test/mlir-cuda-runner/shuffle.mlir b/mlir/test/mlir-cuda-runner/shuffle.mlir --- a/mlir/test/mlir-cuda-runner/shuffle.mlir +++ b/mlir/test/mlir-cuda-runner/shuffle.mlir @@ -28,4 +28,4 @@ return } -func @print_memref_f32(%ptr : memref<*xf32>) +func private @print_memref_f32(%ptr : memref<*xf32>) diff --git a/mlir/test/mlir-cuda-runner/two-modules.mlir b/mlir/test/mlir-cuda-runner/two-modules.mlir --- a/mlir/test/mlir-cuda-runner/two-modules.mlir +++ b/mlir/test/mlir-cuda-runner/two-modules.mlir @@ -25,4 +25,4 @@ return } -func @print_memref_i32(%memref : memref<*xi32>) +func private @print_memref_i32(%memref : memref<*xi32>) diff --git a/mlir/test/mlir-rocm-runner/gpu-to-hsaco.mlir b/mlir/test/mlir-rocm-runner/gpu-to-hsaco.mlir --- a/mlir/test/mlir-rocm-runner/gpu-to-hsaco.mlir +++ b/mlir/test/mlir-rocm-runner/gpu-to-hsaco.mlir @@ -28,5 +28,5 @@ return } -func @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref) -> (memref) -func @print_memref_f32(%ptr : memref<*xf32>) +func private @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref) -> (memref) +func private @print_memref_f32(%ptr : memref<*xf32>) diff --git a/mlir/test/mlir-rocm-runner/vecadd.mlir b/mlir/test/mlir-rocm-runner/vecadd.mlir --- a/mlir/test/mlir-rocm-runner/vecadd.mlir +++ b/mlir/test/mlir-rocm-runner/vecadd.mlir @@ -46,5 +46,5 @@ return } -func @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref) -> (memref) -func @print_memref_f32(%ptr : memref<*xf32>) +func private @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref) -> (memref) +func private @print_memref_f32(%ptr : memref<*xf32>) diff --git a/mlir/test/mlir-rocm-runner/vector-transferops.mlir b/mlir/test/mlir-rocm-runner/vector-transferops.mlir --- a/mlir/test/mlir-rocm-runner/vector-transferops.mlir +++ b/mlir/test/mlir-rocm-runner/vector-transferops.mlir @@ -80,5 +80,5 @@ return } -func @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref) -> (memref) -func @print_memref_f32(%ptr : memref<*xf32>) +func private @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref) -> (memref) +func private @print_memref_f32(%ptr : memref<*xf32>) diff --git a/mlir/test/mlir-spirv-cpu-runner/double.mlir b/mlir/test/mlir-spirv-cpu-runner/double.mlir --- a/mlir/test/mlir-spirv-cpu-runner/double.mlir +++ b/mlir/test/mlir-spirv-cpu-runner/double.mlir @@ -62,6 +62,6 @@ return } - func @fillI32Buffer(%arg0 : memref, %arg1 : i32) - func @print_memref_i32(%ptr : memref<*xi32>) + func private @fillI32Buffer(%arg0 : memref, %arg1 : i32) + func private @print_memref_i32(%ptr : memref<*xi32>) } diff --git a/mlir/test/mlir-spirv-cpu-runner/simple_add.mlir b/mlir/test/mlir-spirv-cpu-runner/simple_add.mlir --- a/mlir/test/mlir-spirv-cpu-runner/simple_add.mlir +++ b/mlir/test/mlir-spirv-cpu-runner/simple_add.mlir @@ -54,8 +54,8 @@ call @print_memref_f32(%result) : (memref<*xf32>) -> () return } - func @fillF32Buffer1D(%arg0 : memref, %arg1 : f32) - func @fillF32Buffer2D(%arg0 : memref, %arg1 : f32) - func @fillF32Buffer3D(%arg0 : memref, %arg1 : f32) - func @print_memref_f32(%arg0 : memref<*xf32>) + func private @fillF32Buffer1D(%arg0 : memref, %arg1 : f32) + func private @fillF32Buffer2D(%arg0 : memref, %arg1 : f32) + func private @fillF32Buffer3D(%arg0 : memref, %arg1 : f32) + func private @print_memref_f32(%arg0 : memref<*xf32>) } diff --git a/mlir/test/mlir-vulkan-runner/addf.mlir b/mlir/test/mlir-vulkan-runner/addf.mlir --- a/mlir/test/mlir-vulkan-runner/addf.mlir +++ b/mlir/test/mlir-vulkan-runner/addf.mlir @@ -44,7 +44,7 @@ call @print_memref_f32(%arg6) : (memref<*xf32>) -> () return } - func @fillResource1DFloat(%0 : memref, %1 : f32) - func @print_memref_f32(%ptr : memref<*xf32>) + func private @fillResource1DFloat(%0 : memref, %1 : f32) + func private @print_memref_f32(%ptr : memref<*xf32>) } diff --git a/mlir/test/mlir-vulkan-runner/addi.mlir b/mlir/test/mlir-vulkan-runner/addi.mlir --- a/mlir/test/mlir-vulkan-runner/addi.mlir +++ b/mlir/test/mlir-vulkan-runner/addi.mlir @@ -43,9 +43,9 @@ call @print_memref_i32(%arg6) : (memref<*xi32>) -> () return } - func @fillResource1DInt(%0 : memref, %1 : i32) - func @fillResource2DInt(%0 : memref, %1 : i32) - func @fillResource3DInt(%0 : memref, %1 : i32) - func @print_memref_i32(%ptr : memref<*xi32>) + func private @fillResource1DInt(%0 : memref, %1 : i32) + func private @fillResource2DInt(%0 : memref, %1 : i32) + func private @fillResource3DInt(%0 : memref, %1 : i32) + func private @print_memref_i32(%ptr : memref<*xi32>) } diff --git a/mlir/test/mlir-vulkan-runner/addi8.mlir b/mlir/test/mlir-vulkan-runner/addi8.mlir --- a/mlir/test/mlir-vulkan-runner/addi8.mlir +++ b/mlir/test/mlir-vulkan-runner/addi8.mlir @@ -44,8 +44,8 @@ call @print_memref_i32(%arg6) : (memref<*xi32>) -> () return } - func @fillResource1DInt8(%0 : memref, %1 : i8) - func @fillResource2DInt8(%0 : memref, %1 : i8) - func @fillResource3DInt(%0 : memref, %1 : i32) - func @print_memref_i32(%ptr : memref<*xi32>) + func private @fillResource1DInt8(%0 : memref, %1 : i8) + func private @fillResource2DInt8(%0 : memref, %1 : i8) + func private @fillResource3DInt(%0 : memref, %1 : i32) + func private @print_memref_i32(%ptr : memref<*xi32>) } diff --git a/mlir/test/mlir-vulkan-runner/mulf.mlir b/mlir/test/mlir-vulkan-runner/mulf.mlir --- a/mlir/test/mlir-vulkan-runner/mulf.mlir +++ b/mlir/test/mlir-vulkan-runner/mulf.mlir @@ -45,7 +45,7 @@ call @print_memref_f32(%arg6) : (memref<*xf32>) -> () return } - func @fillResource2DFloat(%0 : memref, %1 : f32) - func @print_memref_f32(%ptr : memref<*xf32>) + func private @fillResource2DFloat(%0 : memref, %1 : f32) + func private @print_memref_f32(%ptr : memref<*xf32>) } diff --git a/mlir/test/mlir-vulkan-runner/subf.mlir b/mlir/test/mlir-vulkan-runner/subf.mlir --- a/mlir/test/mlir-vulkan-runner/subf.mlir +++ b/mlir/test/mlir-vulkan-runner/subf.mlir @@ -47,7 +47,7 @@ call @print_memref_f32(%arg6) : (memref<*xf32>) -> () return } - func @fillResource2DFloat(%0 : memref, %1 : f32) - func @fillResource3DFloat(%0 : memref, %1 : f32) - func @print_memref_f32(%ptr : memref<*xf32>) + func private @fillResource2DFloat(%0 : memref, %1 : f32) + func private @fillResource3DFloat(%0 : memref, %1 : f32) + func private @print_memref_f32(%ptr : memref<*xf32>) } diff --git a/mlir/test/mlir-vulkan-runner/time.mlir b/mlir/test/mlir-vulkan-runner/time.mlir --- a/mlir/test/mlir-vulkan-runner/time.mlir +++ b/mlir/test/mlir-vulkan-runner/time.mlir @@ -50,7 +50,7 @@ %arg6 = memref_cast %arg5 : memref to memref<*xf32> return } - func @fillResource1DFloat(%0 : memref, %1 : f32) - func @print_memref_f32(%ptr : memref<*xf32>) + func private @fillResource1DFloat(%0 : memref, %1 : f32) + func private @print_memref_f32(%ptr : memref<*xf32>) } diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp --- a/mlir/unittests/Pass/AnalysisManagerTest.cpp +++ b/mlir/unittests/Pass/AnalysisManagerTest.cpp @@ -58,6 +58,7 @@ FuncOp func1 = FuncOp::create(builder.getUnknownLoc(), "foo", builder.getFunctionType(llvm::None, llvm::None)); + func1.setPrivate(); module->push_back(func1); // Test fine grain invalidation of the function analysis manager. @@ -87,6 +88,7 @@ FuncOp func1 = FuncOp::create(builder.getUnknownLoc(), "foo", builder.getFunctionType(llvm::None, llvm::None)); + func1.setPrivate(); module->push_back(func1); // Test fine grain invalidation of a function analysis from within a module diff --git a/mlir/unittests/Pass/PassManagerTest.cpp b/mlir/unittests/Pass/PassManagerTest.cpp --- a/mlir/unittests/Pass/PassManagerTest.cpp +++ b/mlir/unittests/Pass/PassManagerTest.cpp @@ -54,6 +54,7 @@ FuncOp func = FuncOp::create(builder.getUnknownLoc(), name, builder.getFunctionType(llvm::None, llvm::None)); + func.setPrivate(); module->push_back(func); }