- Extend the Symbol interface with `isDeclaration` to identify operations that declare
a symbol as opposed to define it.
- Extend verification to disallow public declarations as per the discussion in
https://llvm.discourse.group/t/rfc-symbol-definition-declaration-x-visibility-checks/2140
- Adopt the new interface for `FuncOp` and fix test and code to not have/create public
function declarations.
Differential Revision: https://reviews.llvm.org/D91456
[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
* 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
* 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
/// Returns the results types that the callable region produces when executed.
ArrayRef<Type> getCallableResults() { return getType().getResults(); }
+ //===--------------------------------------------------------------------===//
+ // SymbolOpInterface Methods
+ //===--------------------------------------------------------------------===//
+
+ bool isDeclaration() { return isExternal(); }
+
private:
// This trait needs access to the hooks defined below.
friend class OpTrait::FunctionLike<FuncOp>;
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 = [{
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 = [{
// 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<?x?xf32>, %B: memref<?x?xf32>) -> (memref<?x?xf32>) {
%c0 = constant 0 : index
// 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
// 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<?xf32> {
// 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<?x?x?xf32> {
// 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<?x?x?xf32> {
// 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<?x?xf32> {
// 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<?x?x?x?xf32> {
// 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<?x?x?x?xf32> {
// 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<?x?x?xf32> {
// 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<?x?x?x?x?xf32> {
// 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<?x?x?x?x?xf32> {
return
}
-func @print_memref_f32(%ptr : tensor<*xf32>)
+func private @print_memref_f32(%ptr : tensor<*xf32>)
// 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>)
return
}
-func @print_memref_f32(%ptr : tensor<*xf32>)
+func private @print_memref_f32(%ptr : tensor<*xf32>)
#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<?x?xf32> {
%c0 = constant 0 : index
// 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<?xf32> {
%c0 = constant 0 : index
// RUN: FileCheck %s
module {
- func @openMatrix(!llvm.ptr<i8>, memref<index>, memref<index>, memref<index>) -> ()
- func @readMatrixItem(memref<index>, memref<index>, memref<f64>) -> ()
- func @closeMatrix() -> ()
- func @getMatrix(index) -> (!llvm.ptr<i8>)
+ func private @openMatrix(!llvm.ptr<i8>, memref<index>, memref<index>, memref<index>) -> ()
+ func private @readMatrixItem(memref<index>, memref<index>, memref<f64>) -> ()
+ func private @closeMatrix() -> ()
+ func private @getMatrix(index) -> (!llvm.ptr<i8>)
func @entry() {
%d0 = constant 0.0 : f64
auto addFuncDecl = [&](StringRef name, FunctionType type) {
if (module.lookupSymbol(name))
return;
- builder.create<FuncOp>(module.getLoc(), name, type);
+ builder.create<FuncOp>(module.getLoc(), name, type).setPrivate();
};
MLIRContext *ctx = module.getContext();
}
// Declare vulkan launch function.
- builder.create<FuncOp>(
- loc, kVulkanLaunch,
- FunctionType::get(vulkanLaunchTypes, {}, loc->getContext()));
+ auto funcType = FunctionType::get(vulkanLaunchTypes, {}, loc->getContext());
+ builder.create<FuncOp>(loc, kVulkanLaunch, funcType).setPrivate();
return success();
}
// 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;
}
-// 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"} {
return
}
- func @func_b()
+ func private @func_b()
// CHECK: Node{{.*}}func_c
// CHECK-NEXT: Call-Edge{{.*}}External-Node
return // CHECK: return
} // CHECK: }
-func @body(index) -> ()
+func private @body(index) -> ()
// Simple loops are properly converted.
// CHECK-LABEL: func @simple_loop
/////////////////////////////////////////////////////////////////////
-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
/////////////////////////////////////////////////////////////////////
-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
/////////////////////////////////////////////////////////////////////
-func @get_idx() -> (index)
+func private @get_idx() -> (index)
#set1 = affine_set<(d0) : (20 - d0 >= 0)>
#set2 = affine_set<(d0) : (d0 - 10 >= 0)>
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
// CHECK-LABEL: @external
// CHECK: %[[ALLOC0:.*]]: !llvm.ptr<float>, %[[ALIGN0:.*]]: !llvm.ptr<float>, %[[OFFSET0:.*]]: !llvm.i64, %[[SIZE00:.*]]: !llvm.i64, %[[SIZE01:.*]]: !llvm.i64, %[[STRIDE00:.*]]: !llvm.i64, %[[STRIDE01:.*]]: !llvm.i64,
// CHECK: %[[ALLOC1:.*]]: !llvm.ptr<float>, %[[ALIGN1:.*]]: !llvm.ptr<float>, %[[OFFSET1:.*]]: !llvm.i64)
-func @external(%arg0: memref<?x?xf32>, %arg1: memref<f32>)
+func private @external(%arg0: memref<?x?xf32>, %arg1: memref<f32>)
// Populate the descriptor for arg0.
// CHECK: %[[DESC00:.*]] = llvm.mlir.undef : !llvm.struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>
// CHECK: %[[DESC01:.*]] = llvm.insertvalue %arg0, %[[DESC00]][0]
// Verify that the return value is not affected.
// CHECK-LABEL: @returner
// CHECK: -> !llvm.struct<(struct<(ptr<float>, ptr<float>, i64, array<2 x i64>, array<2 x i64>)>, struct<(ptr<float>, ptr<float>, i64)>)>
-func @returner() -> (memref<?x?xf32>, memref<f32>)
+func private @returner() -> (memref<?x?xf32>, memref<f32>)
// CHECK-LABEL: @caller
func @caller() {
// RUN: mlir-opt -convert-std-to-llvm %s | FileCheck %s
//CHECK: llvm.func @second_order_arg(!llvm.ptr<func<void ()>>)
-func @second_order_arg(%arg0 : () -> ())
+func private @second_order_arg(%arg0 : () -> ())
//CHECK: llvm.func @second_order_result() -> !llvm.ptr<func<void ()>>
-func @second_order_result() -> (() -> ())
+func private @second_order_result() -> (() -> ())
//CHECK: llvm.func @second_order_multi_result() -> !llvm.struct<(ptr<func<i32 ()>>, ptr<func<i64 ()>>, ptr<func<float ()>>)>
-func @second_order_multi_result() -> (() -> (i32), () -> (i64), () -> (f32))
+func private @second_order_multi_result() -> (() -> (i32), () -> (i64), () -> (f32))
//CHECK: llvm.func @third_order(!llvm.ptr<func<ptr<func<void ()>> (ptr<func<void ()>>)>>) -> !llvm.ptr<func<ptr<func<void ()>> (ptr<func<void ()>>)>>
-func @third_order(%arg0 : (() -> ()) -> (() -> ())) -> ((() -> ()) -> (() -> ()))
+func private @third_order(%arg0 : (() -> ()) -> (() -> ())) -> ((() -> ()) -> (() -> ()))
//CHECK: llvm.func @fifth_order_left(!llvm.ptr<func<void (ptr<func<void (ptr<func<void (ptr<func<void ()>>)>>)>>)>>)
-func @fifth_order_left(%arg0: (((() -> ()) -> ()) -> ()) -> ())
+func private @fifth_order_left(%arg0: (((() -> ()) -> ()) -> ()) -> ())
//CHECK: llvm.func @fifth_order_right(!llvm.ptr<func<ptr<func<ptr<func<ptr<func<void ()>> ()>> ()>> ()>>)
-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<float>, !llvm.ptr<float>, !llvm.i64, !llvm.i64, !llvm.i64)
-func @memref_call_conv(%arg0: memref<?xf32>)
+func private @memref_call_conv(%arg0: memref<?xf32>)
// Same in nested functions.
// CHECK: llvm.func @memref_call_conv_nested(!llvm.ptr<func<void (ptr<float>, ptr<float>, i64, i64, i64)>>)
-func @memref_call_conv_nested(%arg0: (memref<?xf32>) -> ())
+func private @memref_call_conv_nested(%arg0: (memref<?xf32>) -> ())
//CHECK-LABEL: llvm.func @pass_through(%arg0: !llvm.ptr<func<void ()>>) -> !llvm.ptr<func<void ()>> {
func @pass_through(%arg0: () -> ()) -> (() -> ()) {
}
// 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) {
// -----
// BAREPTR: llvm.func @foo(!llvm.ptr<i8>) -> !llvm.ptr<i8>
-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<i8>) -> !llvm.ptr<i8>
// -----
// 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)
// 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> {
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() {
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
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
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() {
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<f16>)
-// CHECK-LABEL: func @get_c32() -> !llvm.struct<(float, float)>
-func @get_c32() -> (complex<f32>)
-// CHECK-LABEL: func @get_c64() -> !llvm.struct<(double, double)>
-func @get_c64() -> (complex<f64>)
-// CHECK-LABEL: func @get_memref() -> !llvm.struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>
-// CHECK32-LABEL: func @get_memref() -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)> {
-// CHECK32-LABEL: func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, 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<f16>)
+// CHECK-LABEL: llvm.func @get_c32() -> !llvm.struct<(float, float)>
+func private @get_c32() -> (complex<f32>)
+// CHECK-LABEL: llvm.func @get_c64() -> !llvm.struct<(double, double)>
+func private @get_c64() -> (complex<f64>)
+// CHECK-LABEL: llvm.func @get_memref() -> !llvm.struct<(ptr<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>
+// CHECK32-LABEL: llvm.func @get_memref() -> !llvm.struct<(ptr<float>, ptr<float>, 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)> {
+// CHECK32-LABEL: llvm.func @multireturn() -> !llvm.struct<(i64, float, struct<(ptr<float>, ptr<float>, 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
}
-// 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<float>, ptr<float>, i64, array<4 x i64>, array<4 x i64>)>)>
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>
// -----
// 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>)
}
return
}
-func @external()
+func private @external()
// CHECK: affine.for %[[I:.*]] = 0 to 100 {
// CHECK-NEXT: affine.store %{{.*}}, %[[A]][%[[I]]]
// -----
-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) {
// CHECK-NEXT: }
// CHECK-NEXT: return
-func @external()
+func private @external()
// 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() {
// -----
// 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)
gpu.func @kernel() kernel { gpu.return }
}
- func @foo() -> ()
+ func private @foo() -> ()
// CHECK-LABEL:func @async(%{{.*}}: index)
func @async(%sz : index) {
// -----
-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}}
// 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<?x?xf32>
// 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<?x?xf32>
// -----
-func @side_effect() {}
+func private @side_effect() {}
func @all_unused() {
%c0 = constant 0 : index
%c1 = constant 1 : index
// -----
-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)
// 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<f32>) -> ()
+func private @missing_count(!spv.array<f32>) -> ()
// -----
// 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>) -> ()
// -----
//===----------------------------------------------------------------------===//
// CHECK: @bool_ptr_type(!spv.ptr<i1, Uniform>)
-func @bool_ptr_type(!spv.ptr<i1, Uniform>) -> ()
+func private @bool_ptr_type(!spv.ptr<i1, Uniform>) -> ()
// CHECK: @scalar_ptr_type(!spv.ptr<f32, Uniform>)
-func @scalar_ptr_type(!spv.ptr<f32, Uniform>) -> ()
+func private @scalar_ptr_type(!spv.ptr<f32, Uniform>) -> ()
// CHECK: @vector_ptr_type(!spv.ptr<vector<4xi32>, PushConstant>)
-func @vector_ptr_type(!spv.ptr<vector<4xi32>,PushConstant>) -> ()
+func private @vector_ptr_type(!spv.ptr<vector<4xi32>,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<f32 Uniform>) -> ()
+func private @missing_comma(!spv.ptr<f32 Uniform>) -> ()
// -----
// 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<f32, SomeStorageClass>) -> ()
+func private @unknown_storage_class(!spv.ptr<f32, SomeStorageClass>) -> ()
// -----
// RuntimeArrayType
//===----------------------------------------------------------------------===//
-// CHECK: func @scalar_runtime_array_type(!spv.rtarray<f32>, !spv.rtarray<i32>)
-func @scalar_runtime_array_type(!spv.rtarray<f32>, !spv.rtarray<i32>) -> ()
+// CHECK: func private @scalar_runtime_array_type(!spv.rtarray<f32>, !spv.rtarray<i32>)
+func private @scalar_runtime_array_type(!spv.rtarray<f32>, !spv.rtarray<i32>) -> ()
-// CHECK: func @vector_runtime_array_type(!spv.rtarray<vector<4xf32>>)
-func @vector_runtime_array_type(!spv.rtarray< vector<4xf32> >) -> ()
+// CHECK: func private @vector_runtime_array_type(!spv.rtarray<vector<4xf32>>)
+func private @vector_runtime_array_type(!spv.rtarray< vector<4xf32> >) -> ()
-// CHECK: func @runtime_array_type_stride(!spv.rtarray<f32, stride=4>)
-func @runtime_array_type_stride(!spv.rtarray<f32, stride=4>) -> ()
+// CHECK: func private @runtime_array_type_stride(!spv.rtarray<f32, stride=4>)
+func private @runtime_array_type_stride(!spv.rtarray<f32, stride=4>) -> ()
// -----
// 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<i32, stride=0>) -> ()
+func private @runtime_array_type_zero_stride(!spv.rtarray<i32, stride=0>) -> ()
// -----
// ImageType
//===----------------------------------------------------------------------===//
-// CHECK: func @image_parameters_1D(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>)
-func @image_parameters_1D(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> ()
+// CHECK: func private @image_parameters_1D(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>)
+func private @image_parameters_1D(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_one_element(!spv.image<f32>) -> ()
+func private @image_parameters_one_element(!spv.image<f32>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_two_elements(!spv.image<f32, Dim1D>) -> ()
+func private @image_parameters_two_elements(!spv.image<f32, Dim1D>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_three_elements(!spv.image<f32, Dim1D, NoDepth>) -> ()
+func private @image_parameters_three_elements(!spv.image<f32, Dim1D, NoDepth>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_four_elements(!spv.image<f32, Dim1D, NoDepth, NonArrayed>) -> ()
+func private @image_parameters_four_elements(!spv.image<f32, Dim1D, NoDepth, NonArrayed>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_five_elements(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled>) -> ()
+func private @image_parameters_five_elements(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_six_elements(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown>) -> ()
+func private @image_parameters_six_elements(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown>) -> ()
// -----
// 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<f32, Dim1D NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> ()
+func private @image_parameters_nocomma_1(!spv.image<f32, Dim1D NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_nocomma_2(!spv.image<f32, Dim1D, NoDepth NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> ()
+func private @image_parameters_nocomma_2(!spv.image<f32, Dim1D, NoDepth NonArrayed, SingleSampled, SamplerUnknown, Unknown>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_nocomma_3(!spv.image<f32, Dim1D, NoDepth, NonArrayed SingleSampled, SamplerUnknown, Unknown>) -> ()
+func private @image_parameters_nocomma_3(!spv.image<f32, Dim1D, NoDepth, NonArrayed SingleSampled, SamplerUnknown, Unknown>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_nocomma_4(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled SamplerUnknown, Unknown>) -> ()
+func private @image_parameters_nocomma_4(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled SamplerUnknown, Unknown>) -> ()
// -----
// expected-error @+1 {{expected ','}}
-func @image_parameters_nocomma_5(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown Unknown>) -> ()
+func private @image_parameters_nocomma_5(!spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown Unknown>) -> ()
// -----
// 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<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>)>)
-func @struct_type_simple(!spv.struct<(f32, !spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>)>) -> ()
+// CHECK: func private @struct_type_simple(!spv.struct<(f32, !spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>)>)
+func private @struct_type_simple(!spv.struct<(f32, !spv.image<f32, Dim1D, NoDepth, NonArrayed, SingleSampled, SamplerUnknown, Unknown>)>) -> ()
-// 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=])>)
// -----
// StructType (identified)
//===----------------------------------------------------------------------===//
-// CHECK: func @id_struct_empty(!spv.struct<empty, ()>)
-func @id_struct_empty(!spv.struct<empty, ()>) -> ()
+// CHECK: func private @id_struct_empty(!spv.struct<empty, ()>)
+func private @id_struct_empty(!spv.struct<empty, ()>) -> ()
// -----
-// CHECK: func @id_struct_simple(!spv.struct<simple, (f32)>)
-func @id_struct_simple(!spv.struct<simple, (f32)>) -> ()
+// CHECK: func private @id_struct_simple(!spv.struct<simple, (f32)>)
+func private @id_struct_simple(!spv.struct<simple, (f32)>) -> ()
// -----
-// CHECK: func @id_struct_multiple_elements(!spv.struct<multi_elements, (f32, i32)>)
-func @id_struct_multiple_elements(!spv.struct<multi_elements, (f32, i32)>) -> ()
+// CHECK: func private @id_struct_multiple_elements(!spv.struct<multi_elements, (f32, i32)>)
+func private @id_struct_multiple_elements(!spv.struct<multi_elements, (f32, i32)>) -> ()
// -----
-// CHECK: func @id_struct_nested_literal(!spv.struct<a1, (!spv.struct<()>)>)
-func @id_struct_nested_literal(!spv.struct<a1, (!spv.struct<()>)>) -> ()
+// CHECK: func private @id_struct_nested_literal(!spv.struct<a1, (!spv.struct<()>)>)
+func private @id_struct_nested_literal(!spv.struct<a1, (!spv.struct<()>)>) -> ()
// -----
-// CHECK: func @id_struct_nested_id(!spv.struct<a2, (!spv.struct<b2, ()>)>)
-func @id_struct_nested_id(!spv.struct<a2, (!spv.struct<b2, ()>)>) -> ()
+// CHECK: func private @id_struct_nested_id(!spv.struct<a2, (!spv.struct<b2, ()>)>)
+func private @id_struct_nested_id(!spv.struct<a2, (!spv.struct<b2, ()>)>) -> ()
// -----
-// CHECK: func @literal_struct_nested_id(!spv.struct<(!spv.struct<a3, ()>)>)
-func @literal_struct_nested_id(!spv.struct<(!spv.struct<a3, ()>)>) -> ()
+// CHECK: func private @literal_struct_nested_id(!spv.struct<(!spv.struct<a3, ()>)>)
+func private @literal_struct_nested_id(!spv.struct<(!spv.struct<a3, ()>)>) -> ()
// -----
-// CHECK: func @id_struct_self_recursive(!spv.struct<a4, (!spv.ptr<!spv.struct<a4>, Uniform>)>)
-func @id_struct_self_recursive(!spv.struct<a4, (!spv.ptr<!spv.struct<a4>, Uniform>)>) -> ()
+// CHECK: func private @id_struct_self_recursive(!spv.struct<a4, (!spv.ptr<!spv.struct<a4>, Uniform>)>)
+func private @id_struct_self_recursive(!spv.struct<a4, (!spv.ptr<!spv.struct<a4>, Uniform>)>) -> ()
// -----
-// CHECK: func @id_struct_self_recursive2(!spv.struct<a5, (i32, !spv.ptr<!spv.struct<a5>, Uniform>)>)
-func @id_struct_self_recursive2(!spv.struct<a5, (i32, !spv.ptr<!spv.struct<a5>, Uniform>)>) -> ()
+// CHECK: func private @id_struct_self_recursive2(!spv.struct<a5, (i32, !spv.ptr<!spv.struct<a5>, Uniform>)>)
+func private @id_struct_self_recursive2(!spv.struct<a5, (i32, !spv.ptr<!spv.struct<a5>, Uniform>)>) -> ()
// -----
// expected-error @+1 {{recursive struct reference not nested in struct definition}}
-func @id_wrong_recursive_reference(!spv.struct<a6>) -> ()
+func private @id_wrong_recursive_reference(!spv.struct<a6>) -> ()
// -----
// expected-error @+1 {{recursive struct reference not nested in struct definition}}
-func @id_struct_recursive_invalid(!spv.struct<a7, (!spv.ptr<!spv.struct<b7>, Uniform>)>) -> ()
+func private @id_struct_recursive_invalid(!spv.struct<a7, (!spv.ptr<!spv.struct<b7>, Uniform>)>) -> ()
// -----
// expected-error @+1 {{identifier already used for an enclosing struct}}
-func @id_struct_redefinition(!spv.struct<a8, (!spv.ptr<!spv.struct<a8, (!spv.ptr<!spv.struct<a8>, Uniform>)>, Uniform>)>) -> ()
+func private @id_struct_redefinition(!spv.struct<a8, (!spv.ptr<!spv.struct<a8, (!spv.ptr<!spv.struct<a8>, Uniform>)>, Uniform>)>) -> ()
// -----
// Equivalent to:
// struct a { struct b *bPtr; };
// struct b { struct a *aPtr; };
-// CHECK: func @id_struct_recursive(!spv.struct<a9, (!spv.ptr<!spv.struct<b9, (!spv.ptr<!spv.struct<a9>, Uniform>)>, Uniform>)>)
-func @id_struct_recursive(!spv.struct<a9, (!spv.ptr<!spv.struct<b9, (!spv.ptr<!spv.struct<a9>, Uniform>)>, Uniform>)>) -> ()
+// CHECK: func private @id_struct_recursive(!spv.struct<a9, (!spv.ptr<!spv.struct<b9, (!spv.ptr<!spv.struct<a9>, Uniform>)>, Uniform>)>)
+func private @id_struct_recursive(!spv.struct<a9, (!spv.ptr<!spv.struct<b9, (!spv.ptr<!spv.struct<a9>, Uniform>)>, Uniform>)>) -> ()
// -----
// Equivalent to:
// struct a { struct b *bPtr; };
// struct b { struct a *aPtr, struct b *bPtr; };
-// CHECK: func @id_struct_recursive(!spv.struct<a10, (!spv.ptr<!spv.struct<b10, (!spv.ptr<!spv.struct<a10>, Uniform>, !spv.ptr<!spv.struct<b10>, Uniform>)>, Uniform>)>)
-func @id_struct_recursive(!spv.struct<a10, (!spv.ptr<!spv.struct<b10, (!spv.ptr<!spv.struct<a10>, Uniform>, !spv.ptr<!spv.struct<b10>, Uniform>)>, Uniform>)>) -> ()
+// CHECK: func private @id_struct_recursive(!spv.struct<a10, (!spv.ptr<!spv.struct<b10, (!spv.ptr<!spv.struct<a10>, Uniform>, !spv.ptr<!spv.struct<b10>, Uniform>)>, Uniform>)>)
+func private @id_struct_recursive(!spv.struct<a10, (!spv.ptr<!spv.struct<b10, (!spv.ptr<!spv.struct<a10>, Uniform>, !spv.ptr<!spv.struct<b10>, Uniform>)>, Uniform>)>) -> ()
// -----
// 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<i32>'}}
-func @matrix_invalid_type(!spv.matrix< 3 x !spv.rtarray<i32>>) -> ()
+func private @matrix_invalid_type(!spv.matrix< 3 x !spv.rtarray<i32>>) -> ()
// -----
// 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>>) -> ()
// -----
return %0 : tensor<f32>
}
-// CHECK-LABEL: func @source() -> memref<f32>
+// CHECK-LABEL: func private @source() -> memref<f32>
// CHECK-LABEL: func @call_source() -> memref<f32> {
// CHECK: %[[RET:.*]] = call @source() : () -> memref<f32>
// CHECK: return %[[RET]] : memref<f32>
-func @source() -> tensor<f32>
+func private @source() -> tensor<f32>
func @call_source() -> tensor<f32> {
%0 = call @source() : () -> tensor<f32>
return %0 : tensor<f32>
}
-// CHECK-LABEL: func @sink(memref<f32>)
+// CHECK-LABEL: func private @sink(memref<f32>)
// CHECK-LABEL: func @call_sink(
// CHECK-SAME: %[[ARG:.*]]: memref<f32>) {
// CHECK: call @sink(%[[ARG]]) : (memref<f32>) -> ()
// CHECK: return
-func @sink(tensor<f32>)
+func private @sink(tensor<f32>)
func @call_sink(%arg0: tensor<f32>) {
call @sink(%arg0) : (tensor<f32>) -> ()
return
#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<i8, #map{{[0-9]+}}, 1>)
-func @f2(memref<i8, #map2, 1>)
+// CHECK: @f2(memref<i8, #map{{[0-9]+}}, 1>)
+func private @f2(memref<i8, #map2, 1>)
-// 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} : () -> ()
// 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) {
func @f(%arg0: i64) -> (i64 {test.invalid_attr}) {
return %arg0 : i64
}
+
+// -----
+
+// expected-error@+1 {{symbol declaration cannot have public visibility}}
+func @invalid_public_declaration()
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)
// 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<i8>)
-func @tensors(tensor<* x f32>, tensor<* x vector<2x4xf32>>,
+// CHECK: func private @tensors(tensor<*xf32>, tensor<*xvector<2x4xf32>>, tensor<1x?x4x?x?xi32>, tensor<i8>)
+func private @tensors(tensor<* x f32>, tensor<* x vector<2x4xf32>>,
tensor<1x?x4x?x?xi32>, tensor<i8>)
-// 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<i1>) -> complex<f32>
-func @complex_types(complex<i1>) -> complex<f32>
+// CHECK: func private @complex_types(complex<i1>) -> complex<f32>
+func private @complex_types(complex<i1>) -> complex<f32>
-// 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<f32>>)
-func @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
+// CHECK: func private @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
+func private @memref_with_complex_elems(memref<1x?xcomplex<f32>>)
-// 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<f32>>)
-func @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
+// CHECK: func private @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
+func private @unranked_memref_with_complex_elems(memref<*xcomplex<f32>>)
-// 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 {
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:
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}) {
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<i32>)
-func @tuple_single_element(tuple<i32>)
+// CHECK-LABEL: func private @tuple_single_element(tuple<i32>)
+func private @tuple_single_element(tuple<i32>)
-// CHECK-LABEL: func @tuple_multi_element(tuple<i32, i16, f32>)
-func @tuple_multi_element(tuple<i32, i16, f32>)
+// CHECK-LABEL: func private @tuple_multi_element(tuple<i32, i16, f32>)
+func private @tuple_multi_element(tuple<i32, i16, f32>)
-// CHECK-LABEL: func @tuple_nested(tuple<tuple<tuple<i32>>>)
-func @tuple_nested(tuple<tuple<tuple<i32>>>)
+// CHECK-LABEL: func private @tuple_nested(tuple<tuple<tuple<i32>>>)
+func private @tuple_nested(tuple<tuple<tuple<i32>>>)
// CHECK-LABEL: func @pretty_form_multi_result
func @pretty_form_multi_result() -> (i16, i16) {
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() {
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) {
// 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}
// -----
-// 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},
// -----
-// 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},
// -----
-// 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>,
// 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}
// 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
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" }
}
}
// 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"() ({
}) : () -> ()
// 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}}
}
// 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} {
// expected-remark@+1 {{symbol has 1 uses}}
module @module_c {
// expected-remark@+1 {{symbol has 1 uses}}
- func @foo()
+ func nested @foo()
}
}
// 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() {
}
// -----
module {
module @inner_mod1 {
"test.symbol"() {sym_name = "foo"} : () -> ()
- func @bar()
+ func private @bar()
}
}
// 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()
}
return %0, %1, %2 : i1, memref<f32>, i32
}
-// CHECK: func @external_function(memref<f32>)
-func @external_function() -> (memref<f32>)
-// CHECK: func @result_attrs(memref<f32> {test.some_attr})
-func @result_attrs() -> (memref<f32> {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<f32>)
+func private @external_function() -> (memref<f32>)
+// CHECK: func private @result_attrs(memref<f32> {test.some_attr})
+func private @result_attrs() -> (memref<f32> {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>
// -----
-// 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>
// -----
-// 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>
// -----
-func @callee() -> (memref<?xf32>)
+func private @callee() -> (memref<?xf32>)
func @call_non_memref_result() {
// expected-error @+1 {{cannot create out param for dynamically shaped result}}
// Test case: Check decomposition of calls.
-// CHECK-LABEL: func @callee(i1, i32) -> (i1, i32)
-func @callee(tuple<i1, i32>) -> tuple<i1, i32>
+// CHECK-LABEL: func private @callee(i1, i32) -> (i1, i32)
+func private @callee(tuple<i1, i32>) -> tuple<i1, i32>
// CHECK-LABEL: func @caller(
// CHECK-SAME: %[[ARG0:.*]]: i1,
// Test case: Type that decomposes to nothing (that is, a 1:0 decomposition).
-// CHECK-LABEL: func @callee()
-func @callee(tuple<>) -> tuple<>
+// CHECK-LABEL: func private @callee()
+func private @callee(tuple<>) -> tuple<>
// CHECK-LABEL: func @caller() {
// CHECK: call @callee() : () -> ()
// CHECK: return
// Test case: Check mixed decomposed and non-decomposed args.
// This makes sure to test the cases if 1:0, 1:1, and 1:N decompositions.
-// CHECK-LABEL: func @callee(i1, i2, i3, i4, i5, i6) -> (i1, i2, i3, i4, i5, i6)
-func @callee(tuple<>, i1, tuple<i2>, i3, tuple<i4, i5>, i6) -> (tuple<>, i1, tuple<i2>, i3, tuple<i4, i5>, i6)
+// CHECK-LABEL: func private @callee(i1, i2, i3, i4, i5, i6) -> (i1, i2, i3, i4, i5, i6)
+func private @callee(tuple<>, i1, tuple<i2>, i3, tuple<i4, i5>, i6) -> (tuple<>, i1, tuple<i2>, i3, tuple<i4, i5>, i6)
// CHECK-LABEL: func @caller(
// CHECK-SAME: %[[I1:.*]]: i1,
}
-// 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() {
}
// 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() {
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 {
/// 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 {
/// 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 {
// RUN: mlir-opt %s -test-convert-call-op | FileCheck %s
// CHECK-LABEL: llvm.func @callee(!llvm.ptr<i8>) -> !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 {
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) {
func @public_function() {
"foo.return"() {uses = [@live_private_function, @live_nested_function]} : () -> ()
}
-
- // CHECK: func public @public_function_explicit
- func public @public_function_explicit()
}
// -----
return
}
-func @mlirAsyncRuntimePrintCurrentThreadId() -> ()
+func private @mlirAsyncRuntimePrintCurrentThreadId() -> ()
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 }
// External declarations.
llvm.func @malloc(!llvm.i64) -> !llvm.ptr<i8>
llvm.func @free(!llvm.ptr<i8>)
-func @printF32(%arg0: f32)
-func @printComma()
-func @printNewline()
+func private @printF32(%arg0: f32)
+func private @printComma()
+func private @printNewline()
func @main()
{
// 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() {
// 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
// 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
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>)
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>
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>
// 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>
// 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<?x?x!vector_type_C>) attributes { llvm.emit_c_interface }
+func private @print_memref_vector_4x4xf32(memref<?x?x!vector_type_C>) attributes { llvm.emit_c_interface }
return
}
-func @print_memref_i32(memref<*xi32>)
+func private @print_memref_i32(memref<*xi32>)
return
}
-func @print_memref_i32(memref<*xi32>)
+func private @print_memref_i32(memref<*xi32>)
return
}
-func @print_memref_i32(memref<*xi32>)
+func private @print_memref_i32(memref<*xi32>)
return
}
-func @print_memref_f32(%ptr : memref<*xf32>)
+func private @print_memref_f32(%ptr : memref<*xf32>)
return
}
-func @print_memref_i32(memref<*xi32>)
+func private @print_memref_i32(memref<*xi32>)
return
}
-func @print_memref_f32(memref<*xf32>)
+func private @print_memref_f32(memref<*xf32>)
return
}
-func @print_memref_i32(memref<*xi32>)
+func private @print_memref_i32(memref<*xi32>)
return
}
-func @print_memref_f32(%ptr : memref<*xf32>)
+func private @print_memref_f32(%ptr : memref<*xf32>)
return
}
-func @print_memref_f32(memref<*xf32>)
+func private @print_memref_f32(memref<*xf32>)
return
}
-func @print_memref_f32(%ptr : memref<*xf32>)
+func private @print_memref_f32(%ptr : memref<*xf32>)
return
}
-func @print_memref_i32(%memref : memref<*xi32>)
+func private @print_memref_i32(%memref : memref<*xi32>)
return
}
-func @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref<?xf32>) -> (memref<?xf32>)
-func @print_memref_f32(%ptr : memref<*xf32>)
+func private @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref<?xf32>) -> (memref<?xf32>)
+func private @print_memref_f32(%ptr : memref<*xf32>)
return
}
-func @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref<?xf32>) -> (memref<?xf32>)
-func @print_memref_f32(%ptr : memref<*xf32>)
+func private @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref<?xf32>) -> (memref<?xf32>)
+func private @print_memref_f32(%ptr : memref<*xf32>)
return
}
-func @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref<?xf32>) -> (memref<?xf32>)
-func @print_memref_f32(%ptr : memref<*xf32>)
+func private @mgpuMemGetDeviceMemRef1dFloat(%ptr : memref<?xf32>) -> (memref<?xf32>)
+func private @print_memref_f32(%ptr : memref<*xf32>)
return
}
- func @fillI32Buffer(%arg0 : memref<?xi32>, %arg1 : i32)
- func @print_memref_i32(%ptr : memref<*xi32>)
+ func private @fillI32Buffer(%arg0 : memref<?xi32>, %arg1 : i32)
+ func private @print_memref_i32(%ptr : memref<*xi32>)
}
call @print_memref_f32(%result) : (memref<*xf32>) -> ()
return
}
- func @fillF32Buffer1D(%arg0 : memref<?xf32>, %arg1 : f32)
- func @fillF32Buffer2D(%arg0 : memref<?x?xf32>, %arg1 : f32)
- func @fillF32Buffer3D(%arg0 : memref<?x?x?xf32>, %arg1 : f32)
- func @print_memref_f32(%arg0 : memref<*xf32>)
+ func private @fillF32Buffer1D(%arg0 : memref<?xf32>, %arg1 : f32)
+ func private @fillF32Buffer2D(%arg0 : memref<?x?xf32>, %arg1 : f32)
+ func private @fillF32Buffer3D(%arg0 : memref<?x?x?xf32>, %arg1 : f32)
+ func private @print_memref_f32(%arg0 : memref<*xf32>)
}
call @print_memref_f32(%arg6) : (memref<*xf32>) -> ()
return
}
- func @fillResource1DFloat(%0 : memref<?xf32>, %1 : f32)
- func @print_memref_f32(%ptr : memref<*xf32>)
+ func private @fillResource1DFloat(%0 : memref<?xf32>, %1 : f32)
+ func private @print_memref_f32(%ptr : memref<*xf32>)
}
call @print_memref_i32(%arg6) : (memref<*xi32>) -> ()
return
}
- func @fillResource1DInt(%0 : memref<?xi32>, %1 : i32)
- func @fillResource2DInt(%0 : memref<?x?xi32>, %1 : i32)
- func @fillResource3DInt(%0 : memref<?x?x?xi32>, %1 : i32)
- func @print_memref_i32(%ptr : memref<*xi32>)
+ func private @fillResource1DInt(%0 : memref<?xi32>, %1 : i32)
+ func private @fillResource2DInt(%0 : memref<?x?xi32>, %1 : i32)
+ func private @fillResource3DInt(%0 : memref<?x?x?xi32>, %1 : i32)
+ func private @print_memref_i32(%ptr : memref<*xi32>)
}
call @print_memref_i32(%arg6) : (memref<*xi32>) -> ()
return
}
- func @fillResource1DInt8(%0 : memref<?xi8>, %1 : i8)
- func @fillResource2DInt8(%0 : memref<?x?xi8>, %1 : i8)
- func @fillResource3DInt(%0 : memref<?x?x?xi32>, %1 : i32)
- func @print_memref_i32(%ptr : memref<*xi32>)
+ func private @fillResource1DInt8(%0 : memref<?xi8>, %1 : i8)
+ func private @fillResource2DInt8(%0 : memref<?x?xi8>, %1 : i8)
+ func private @fillResource3DInt(%0 : memref<?x?x?xi32>, %1 : i32)
+ func private @print_memref_i32(%ptr : memref<*xi32>)
}
call @print_memref_f32(%arg6) : (memref<*xf32>) -> ()
return
}
- func @fillResource2DFloat(%0 : memref<?x?xf32>, %1 : f32)
- func @print_memref_f32(%ptr : memref<*xf32>)
+ func private @fillResource2DFloat(%0 : memref<?x?xf32>, %1 : f32)
+ func private @print_memref_f32(%ptr : memref<*xf32>)
}
call @print_memref_f32(%arg6) : (memref<*xf32>) -> ()
return
}
- func @fillResource2DFloat(%0 : memref<?x?xf32>, %1 : f32)
- func @fillResource3DFloat(%0 : memref<?x?x?xf32>, %1 : f32)
- func @print_memref_f32(%ptr : memref<*xf32>)
+ func private @fillResource2DFloat(%0 : memref<?x?xf32>, %1 : f32)
+ func private @fillResource3DFloat(%0 : memref<?x?x?xf32>, %1 : f32)
+ func private @print_memref_f32(%ptr : memref<*xf32>)
}
%arg6 = memref_cast %arg5 : memref<?xf32> to memref<*xf32>
return
}
- func @fillResource1DFloat(%0 : memref<?xf32>, %1 : f32)
- func @print_memref_f32(%ptr : memref<*xf32>)
+ func private @fillResource1DFloat(%0 : memref<?xf32>, %1 : f32)
+ func private @print_memref_f32(%ptr : memref<*xf32>)
}
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.
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
FuncOp func =
FuncOp::create(builder.getUnknownLoc(), name,
builder.getFunctionType(llvm::None, llvm::None));
+ func.setPrivate();
module->push_back(func);
}