diff --git a/flang/include/flang/Optimizer/Builder/FIRBuilder.h b/flang/include/flang/Optimizer/Builder/FIRBuilder.h index e4c954159f71be..5ef041055e99c2 100644 --- a/flang/include/flang/Optimizer/Builder/FIRBuilder.h +++ b/flang/include/flang/Optimizer/Builder/FIRBuilder.h @@ -705,9 +705,6 @@ fir::BoxValue createBoxValue(fir::FirOpBuilder &builder, mlir::Location loc, /// Generate Null BoxProc for procedure pointer null initialization. mlir::Value createNullBoxProc(fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type boxType); - -/// Set internal linkage attribute on a function. -void setInternalLinkage(mlir::func::FuncOp); } // namespace fir::factory #endif // FORTRAN_OPTIMIZER_BUILDER_FIRBUILDER_H diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp index 47bd6ace4e4b56..28ce3e50997e45 100644 --- a/flang/lib/Lower/Bridge.cpp +++ b/flang/lib/Lower/Bridge.cpp @@ -4656,16 +4656,7 @@ class FirConverter : public Fortran::lower::AbstractConverter { assert(builder && "FirOpBuilder did not instantiate"); builder->setFastMathFlags(bridge.getLoweringOptions().getMathOptions()); builder->setInsertionPointToStart(&func.front()); - if (funit.parent.isA()) { - // Give internal linkage to internal functions. There are no name clash - // risks, but giving global linkage to internal procedure will break the - // static link register in shared libraries because of the system calls. - // Also, it should be possible to eliminate the procedure code if all the - // uses have been inlined. - fir::factory::setInternalLinkage(func); - } else { - func.setVisibility(mlir::SymbolTable::Visibility::Public); - } + func.setVisibility(mlir::SymbolTable::Visibility::Public); assert(blockId == 0 && "invalid blockId"); assert(activeConstructStack.empty() && "invalid construct stack state"); diff --git a/flang/lib/Optimizer/Builder/FIRBuilder.cpp b/flang/lib/Optimizer/Builder/FIRBuilder.cpp index b09da4929a8a27..a90b72073e6400 100644 --- a/flang/lib/Optimizer/Builder/FIRBuilder.cpp +++ b/flang/lib/Optimizer/Builder/FIRBuilder.cpp @@ -19,7 +19,6 @@ #include "flang/Optimizer/Dialect/FIRType.h" #include "flang/Optimizer/Support/FatalError.h" #include "flang/Optimizer/Support/InternalNames.h" -#include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/OpenACC/OpenACC.h" #include "mlir/Dialect/OpenMP/OpenMPDialect.h" #include "llvm/ADT/ArrayRef.h" @@ -1589,10 +1588,3 @@ mlir::Value fir::factory::createNullBoxProc(fir::FirOpBuilder &builder, mlir::Value initVal{builder.create(loc, boxEleTy)}; return builder.create(loc, boxTy, initVal); } - -void fir::factory::setInternalLinkage(mlir::func::FuncOp func) { - auto internalLinkage = mlir::LLVM::linkage::Linkage::Internal; - auto linkage = - mlir::LLVM::LinkageAttr::get(func->getContext(), internalLinkage); - func->setAttr("llvm.linkage", linkage); -} diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp index 4ee7258004fa74..ccdaac54ec892a 100644 --- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp +++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp @@ -1888,7 +1888,10 @@ mlir::func::FuncOp IntrinsicLibrary::getWrapper(GeneratorType generator, // First time this wrapper is needed, build it. function = builder.createFunction(loc, wrapperName, funcType); function->setAttr("fir.intrinsic", builder.getUnitAttr()); - fir::factory::setInternalLinkage(function); + auto internalLinkage = mlir::LLVM::linkage::Linkage::Internal; + auto linkage = + mlir::LLVM::LinkageAttr::get(builder.getContext(), internalLinkage); + function->setAttr("llvm.linkage", linkage); function.addEntryBlock(); // Create local context to emit code into the newly created function diff --git a/flang/test/Lower/HLFIR/allocatable-end-of-scope-dealloc.f90 b/flang/test/Lower/HLFIR/allocatable-end-of-scope-dealloc.f90 index 05cae6e5ba6ccf..ad4b015ef9443f 100644 --- a/flang/test/Lower/HLFIR/allocatable-end-of-scope-dealloc.f90 +++ b/flang/test/Lower/HLFIR/allocatable-end-of-scope-dealloc.f90 @@ -224,7 +224,7 @@ subroutine internal() allocate(x) end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFno_dealloc_host_assocPinternal +! CHECK-LABEL: func.func @_QFno_dealloc_host_assocPinternal ! CHECK-NOT: freemem ! CHECK-NOT: Deallocate ! CHECK: return diff --git a/flang/test/Lower/HLFIR/bindc_internal_proc.f90 b/flang/test/Lower/HLFIR/bindc_internal_proc.f90 index 00e24c7016f19f..027c94f95a326e 100644 --- a/flang/test/Lower/HLFIR/bindc_internal_proc.f90 +++ b/flang/test/Lower/HLFIR/bindc_internal_proc.f90 @@ -3,7 +3,7 @@ ! internal procedures. ! RUN: bbc -emit-hlfir %s -o - | FileCheck %s -!CHECK: func.func private @_QFsub1Pfoo(%{{.*}}: i32 +!CHECK: func.func @_QFsub1Pfoo(%{{.*}}: i32 subroutine sub1() call foo(42) contains @@ -13,7 +13,7 @@ subroutine foo(i) bind(c) end subroutine end subroutine -!CHECK: func.func private @_QFsub2Pfoo(%{{.*}}: i64 +!CHECK: func.func @_QFsub2Pfoo(%{{.*}}: i64 subroutine sub2() call foo(42_8) contains diff --git a/flang/test/Lower/HLFIR/internal-procedures-2.f90 b/flang/test/Lower/HLFIR/internal-procedures-2.f90 index f1c4780954b24d..bb05545bef1aa2 100644 --- a/flang/test/Lower/HLFIR/internal-procedures-2.f90 +++ b/flang/test/Lower/HLFIR/internal-procedures-2.f90 @@ -23,7 +23,7 @@ subroutine internal_procedure(i, mask) end forall end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFhost_procedurePinternal_procedure( +! CHECK-LABEL: func.func @_QFhost_procedurePinternal_procedure( ! CHECK: fir.address_of(@_QMmodule_used_by_hostEindexed_by_var) : !fir.ref> ! CHECK: fir.address_of(@_QMmodule_used_by_hostEref_in_forall) : !fir.ref> ! CHECK: fir.address_of(@_QMmodule_used_by_hostEref_in_implied_do) : !fir.ref diff --git a/flang/test/Lower/HLFIR/internal-procedures.f90 b/flang/test/Lower/HLFIR/internal-procedures.f90 index c898903b6fbe11..d517cb4345afa9 100644 --- a/flang/test/Lower/HLFIR/internal-procedures.f90 +++ b/flang/test/Lower/HLFIR/internal-procedures.f90 @@ -9,8 +9,8 @@ subroutine internal call takes_array(x) end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFtest_explicit_shape_arrayPinternal( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QFtest_explicit_shape_arrayPinternal( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref>>>, i32) -> !fir.ref>> ! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.ref>> @@ -27,8 +27,8 @@ subroutine internal call takes_array(x) end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFtest_assumed_shapePinternal( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QFtest_assumed_shapePinternal( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref>>>, i32) -> !fir.ref>> ! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.ref>> @@ -44,8 +44,8 @@ subroutine internal() call bar(c) end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFtest_scalar_charPinternal( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QFtest_scalar_charPinternal( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref>>, i32) -> !fir.ref> ! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.ref> diff --git a/flang/test/Lower/Intrinsics/random.f90 b/flang/test/Lower/Intrinsics/random.f90 index 4fb1a9a5da27a7..ca194befd02741 100644 --- a/flang/test/Lower/Intrinsics/random.f90 +++ b/flang/test/Lower/Intrinsics/random.f90 @@ -45,7 +45,7 @@ subroutine random_test_2 call foo(size) call bar(size, get) contains - ! CHECK-LABEL: func private @_QFrandom_test_2Pfoo + ! CHECK-LABEL: func @_QFrandom_test_2Pfoo subroutine foo(size, put, get) ! CHECK: [[s1:%[0-9]+]] = fir.is_present %arg0 ! CHECK: [[s2:%[0-9]+]] = fir.embox %arg0 @@ -70,7 +70,7 @@ subroutine foo(size, put, get) print*, size end subroutine - ! CHECK-LABEL: func private @_QFrandom_test_2Pbar + ! CHECK-LABEL: func @_QFrandom_test_2Pbar subroutine bar(size, get, put) integer, optional :: size ! CHECK: [[p1:%[0-9]+]] = fir.is_present %arg2 diff --git a/flang/test/Lower/Intrinsics/ubound01.f90 b/flang/test/Lower/Intrinsics/ubound01.f90 index df51d79eb6afe0..4ebe3870cf0b36 100644 --- a/flang/test/Lower/Intrinsics/ubound01.f90 +++ b/flang/test/Lower/Intrinsics/ubound01.f90 @@ -16,7 +16,7 @@ subroutine s2(a,n,n2) End Subroutine end -! CHECK-LABEL: func.func private @_QFPs2 +! CHECK-LABEL: func.func @_QFPs2 ! CHECK-SAME: %[[ARG0:.*]]: !fir.box> ! CHECK: %[[BOX:.*]] = fir.rebox %[[ARG0]](%{{.*}}) : (!fir.box>, !fir.shift<2>) -> !fir.box> ! CHECK: %[[BOX_NONE:.*]] = fir.convert %[[BOX]] : (!fir.box>) -> !fir.box diff --git a/flang/test/Lower/OpenACC/acc-routine04.f90 b/flang/test/Lower/OpenACC/acc-routine04.f90 index 2339c23eaaf857..b5f5aa2ca4882e 100644 --- a/flang/test/Lower/OpenACC/acc-routine04.f90 +++ b/flang/test/Lower/OpenACC/acc-routine04.f90 @@ -31,4 +31,4 @@ subroutine sub2() ! CHECK: acc.routine @acc_routine_0 func(@_QMdummy_modPsub1) seq ! CHECK: func.func @_QMdummy_modPsub1(%arg0: !fir.ref {fir.bindc_name = "i"}) attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>} ! CHECK: func.func @_QQmain() attributes {fir.bindc_name = "test_acc_routine"} -! CHECK: func.func private @_QFPsub2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>, llvm.linkage = #llvm.linkage} +! CHECK: func.func @_QFPsub2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>} diff --git a/flang/test/Lower/OpenMP/FIR/threadprivate-use-association-2.f90 b/flang/test/Lower/OpenMP/FIR/threadprivate-use-association-2.f90 index 6db5735c21f1e1..14c0dff8da4bb1 100644 --- a/flang/test/Lower/OpenMP/FIR/threadprivate-use-association-2.f90 +++ b/flang/test/Lower/OpenMP/FIR/threadprivate-use-association-2.f90 @@ -17,7 +17,7 @@ module m ! CHECK: return ! CHECK: } ! -! CHECK-LABEL: func.func private @_QMm2FtestPinternal_test() {{.*}} { +! CHECK-LABEL: func.func @_QMm2FtestPinternal_test() { ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMmEx) : !fir.ref ! CHECK: %[[VAL_1:.*]] = omp.threadprivate %[[VAL_0]] : !fir.ref -> !fir.ref ! CHECK: fir.call @_QPbar(%[[VAL_1]]) {{.*}}: (!fir.ref) -> () diff --git a/flang/test/Lower/OpenMP/threadprivate-commonblock-use.f90 b/flang/test/Lower/OpenMP/threadprivate-commonblock-use.f90 index 71f1c7608a2c31..28616f7595a0d6 100644 --- a/flang/test/Lower/OpenMP/threadprivate-commonblock-use.f90 +++ b/flang/test/Lower/OpenMP/threadprivate-commonblock-use.f90 @@ -15,7 +15,7 @@ module m1 subroutine ss1 use m0 contains -!CHECK-LABEL: func private @_QMm1Fss1Pss2 +!CHECK-LABEL: func @_QMm1Fss1Pss2 !CHECK: %[[CMN:.*]] = fir.address_of(@cmn_) : !fir.ref> !CHECK: omp.parallel !CHECK: %{{.*}} = omp.threadprivate %[[CMN]] : !fir.ref> -> !fir.ref> diff --git a/flang/test/Lower/OpenMP/threadprivate-use-association-2-hlfir.f90 b/flang/test/Lower/OpenMP/threadprivate-use-association-2-hlfir.f90 index 79a1ce9897f256..722f023fbefc96 100644 --- a/flang/test/Lower/OpenMP/threadprivate-use-association-2-hlfir.f90 +++ b/flang/test/Lower/OpenMP/threadprivate-use-association-2-hlfir.f90 @@ -19,7 +19,7 @@ module m ! CHECK: return ! CHECK: } -! CHECK-LABEL: func.func private @_QMm2FtestPinternal_test() {{.*}} { +! CHECK-LABEL: func.func @_QMm2FtestPinternal_test() { ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMmEx) : !fir.ref ! CHECK: %[[VAL_1:.*]]:2 = hlfir.declare %[[VAL_0]] {uniq_name = "_QMmEx"} : (!fir.ref) -> (!fir.ref, !fir.ref) ! CHECK: %[[VAL_2:.*]] = omp.threadprivate %[[VAL_1]]#1 : !fir.ref -> !fir.ref diff --git a/flang/test/Lower/PowerPC/ppc-vector-types.f90 b/flang/test/Lower/PowerPC/ppc-vector-types.f90 index 4745e4567b2d12..be293f873ecb42 100644 --- a/flang/test/Lower/PowerPC/ppc-vector-types.f90 +++ b/flang/test/Lower/PowerPC/ppc-vector-types.f90 @@ -44,7 +44,7 @@ program ppc_vec_unit ! CHECK-LLVM-NEXT: store <512 x i1> %[[RESQ]], ptr @_QFEvq2, align 64 contains - ! CHECK-LLVM-LABEL: define internal <4 x i32> @_QFPtest_vec_integer_assign + ! CHECK-LLVM-LABEL: define <4 x i32> @_QFPtest_vec_integer_assign function test_vec_integer_assign(arg1) ! CHECK-LLVM: %[[FUNC_RES:.*]] = alloca <4 x i32>, i64 1, align 16 vector(integer(4)) :: arg1, test_vec_integer_assign @@ -58,7 +58,7 @@ function test_vec_integer_assign(arg1) ! CHECK-LLVM-NEXT: ret <4 x i32> %[[RET]] end function test_vec_integer_assign - ! CHECK-LLVM-LABEL: define internal <2 x double> @_QFPtest_vec_real_assign + ! CHECK-LLVM-LABEL: define <2 x double> @_QFPtest_vec_real_assign function test_vec_real_assign(arg1) ! CHECK-LLVM: %[[FUNC_RES:.*]] = alloca <2 x double>, i64 1, align 16 vector(real(8)) :: arg1, test_vec_real_assign @@ -72,7 +72,7 @@ function test_vec_real_assign(arg1) ! CHECK-LLVM-NEXT: ret <2 x double> %[[RET]] end function test_vec_real_assign - ! CHECK-LLVM-LABEL: define internal <8 x i16> @_QFPtest_vec_unsigned_assign + ! CHECK-LLVM-LABEL: define <8 x i16> @_QFPtest_vec_unsigned_assign function test_vec_unsigned_assign(arg1) ! CHECK-LLVM: %[[FUNC_RES:.*]] = alloca <8 x i16>, i64 1, align 16 vector(unsigned(2)) :: arg1, test_vec_unsigned_assign @@ -86,7 +86,7 @@ function test_vec_unsigned_assign(arg1) ! CHECK-LLVM-NEXT: ret <8 x i16> %[[RET]] end function test_vec_unsigned_assign - ! CHECK-LLVM-LABEL: define internal <256 x i1> @_QFPtest_vec_pair_assign + ! CHECK-LLVM-LABEL: define <256 x i1> @_QFPtest_vec_pair_assign function test_vec_pair_assign(arg1) ! CHECK-LLVM: %[[FUNC_RES:.*]] = alloca <256 x i1>, i64 1, align 32 __vector_pair :: arg1, test_vec_pair_assign @@ -100,7 +100,7 @@ function test_vec_pair_assign(arg1) ! CHECK-LLVM-NEXT: ret <256 x i1> %[[RET]] end function test_vec_pair_assign - ! CHECK-LLVM-LABEL: define internal <512 x i1> @_QFPtest_vec_quad_assign + ! CHECK-LLVM-LABEL: define <512 x i1> @_QFPtest_vec_quad_assign function test_vec_quad_assign(arg1) ! CHECK-LLVM: %[[FUNC_RES:.*]] = alloca <512 x i1>, i64 1, align 64 __vector_quad :: arg1, test_vec_quad_assign diff --git a/flang/test/Lower/array-temp.f90 b/flang/test/Lower/array-temp.f90 index 10c5ee91d44bda..347d4cef78bcd1 100644 --- a/flang/test/Lower/array-temp.f90 +++ b/flang/test/Lower/array-temp.f90 @@ -404,7 +404,7 @@ subroutine tt1 ! CHECK-NEXT: fir.call @_FortranAioEndIoStatement print*, [(r([7.0]),i=1,3)] contains - ! CHECK-LABEL: func private @_QFtt1Pr + ! CHECK-LABEL: func @_QFtt1Pr function r(x) real x(:) r = x(1) diff --git a/flang/test/Lower/dummy-arguments.f90 b/flang/test/Lower/dummy-arguments.f90 index 331e089a60fa02..43d8e3c1e5d448 100644 --- a/flang/test/Lower/dummy-arguments.f90 +++ b/flang/test/Lower/dummy-arguments.f90 @@ -9,7 +9,7 @@ program test1 call foo(10) contains -! CHECK-LABEL: func private @_QFPfoo +! CHECK-LABEL: func @_QFPfoo subroutine foo(avar1) integer :: avar1 ! integer :: my_data, my_data2 diff --git a/flang/test/Lower/dummy-procedure-character.f90 b/flang/test/Lower/dummy-procedure-character.f90 index 72d548513fb270..cecd839287ed13 100644 --- a/flang/test/Lower/dummy-procedure-character.f90 +++ b/flang/test/Lower/dummy-procedure-character.f90 @@ -213,7 +213,7 @@ subroutine host(f) ! CHECK: fir.call @_QFhostPintern(%[[VAL_1]]) call intern() contains -! CHECK-LABEL: func private @_QFhostPintern( +! CHECK-LABEL: func @_QFhostPintern( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref ()>, i64>>> {fir.host_assoc}) subroutine intern() ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 @@ -242,7 +242,7 @@ subroutine host2(f) ! CHECK: fir.call @_QFhost2Pintern(%[[VAL_1]]) call intern() contains -! CHECK-LABEL: func private @_QFhost2Pintern( +! CHECK-LABEL: func @_QFhost2Pintern( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref ()>, i64>>> {fir.host_assoc}) subroutine intern() ! CHECK: %[[VAL_1:.*]] = fir.alloca !fir.char<1,42> {bindc_name = ".result"} diff --git a/flang/test/Lower/equivalence-with-host-assoc.f90 b/flang/test/Lower/equivalence-with-host-assoc.f90 index 0ffb1bc5bf9ee1..ec84fb506314ba 100644 --- a/flang/test/Lower/equivalence-with-host-assoc.f90 +++ b/flang/test/Lower/equivalence-with-host-assoc.f90 @@ -10,7 +10,7 @@ subroutine inner i1 = j1 end subroutine inner end subroutine test1 -! FIR-LABEL: func.func private @_QFtest1Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! FIR-LABEL: func.func @_QFtest1Pinner() attributes {fir.internal_proc} { ! FIR: %[[VAL_0:.*]] = fir.address_of(@_QFtest1Ei1) : !fir.ref> ! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! FIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -24,7 +24,7 @@ end subroutine test1 ! FIR: return ! FIR: } -! HLFIR-LABEL: func.func private @_QFtest1Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! HLFIR-LABEL: func.func @_QFtest1Pinner() attributes {fir.internal_proc} { ! HLFIR: %[[VAL_0:.*]] = fir.address_of(@_QFtest1Ei1) : !fir.ref> ! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -54,7 +54,7 @@ subroutine inner end subroutine inner end subroutine host end module test2 -! FIR-LABEL: func.func private @_QMtest2FhostPinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! FIR-LABEL: func.func @_QMtest2FhostPinner() attributes {fir.internal_proc} { ! FIR: %[[VAL_0:.*]] = fir.address_of(@_QMtest2FhostEf1) : !fir.ref> ! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! FIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -68,7 +68,7 @@ end module test2 ! FIR: return ! FIR: } -! HLFIR-LABEL: func.func private @_QMtest2FhostPinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! HLFIR-LABEL: func.func @_QMtest2FhostPinner() attributes {fir.internal_proc} { ! HLFIR: %[[VAL_0:.*]] = fir.address_of(@_QMtest2FhostEf1) : !fir.ref> ! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -94,7 +94,7 @@ subroutine inner i1 = j1 + k1 end subroutine inner end subroutine test3 -! FIR-LABEL: func.func private @_QFtest3Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! FIR-LABEL: func.func @_QFtest3Pinner() attributes {fir.internal_proc} { ! FIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref> ! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! FIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -115,7 +115,7 @@ end subroutine test3 ! FIR: return ! FIR: } -! HLFIR-LABEL: func.func private @_QFtest3Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! HLFIR-LABEL: func.func @_QFtest3Pinner() attributes {fir.internal_proc} { ! HLFIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref> ! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -149,7 +149,7 @@ subroutine inner i1 = j1 + k1 end subroutine inner end subroutine test4 -! FIR-LABEL: func.func private @_QFtest4Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! FIR-LABEL: func.func @_QFtest4Pinner() attributes {fir.internal_proc} { ! FIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref> ! FIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! FIR: %[[VAL_2:.*]] = arith.constant 0 : index @@ -170,7 +170,7 @@ end subroutine test4 ! FIR: return ! FIR: } -! HLFIR-LABEL: func.func private @_QFtest4Pinner() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! HLFIR-LABEL: func.func @_QFtest4Pinner() attributes {fir.internal_proc} { ! HLFIR: %[[VAL_0:.*]] = fir.address_of(@blk_) : !fir.ref> ! HLFIR: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! HLFIR: %[[VAL_2:.*]] = arith.constant 0 : index diff --git a/flang/test/Lower/explicit-interface-results-2.f90 b/flang/test/Lower/explicit-interface-results-2.f90 index 86aae720e7fcf9..4e4b035bae7e1e 100644 --- a/flang/test/Lower/explicit-interface-results-2.f90 +++ b/flang/test/Lower/explicit-interface-results-2.f90 @@ -69,8 +69,8 @@ subroutine host4() integer :: n call internal_proc_a() contains -! CHECK-LABEL: func private @_QFhost4Pinternal_proc_a -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFhost4Pinternal_proc_a +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine internal_proc_a() call takes_array(return_array()) ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 @@ -94,7 +94,7 @@ subroutine host5() implicit none call internal_proc_a() contains -! CHECK-LABEL: func private @_QFhost5Pinternal_proc_a() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFhost5Pinternal_proc_a() attributes {fir.internal_proc} { subroutine internal_proc_a() call takes_array(return_array()) ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMsome_moduleEn_module) : !fir.ref @@ -115,7 +115,7 @@ subroutine host6() implicit none call internal_proc_a() contains -! CHECK-LABEL: func private @_QFhost6Pinternal_proc_a +! CHECK-LABEL: func @_QFhost6Pinternal_proc_a subroutine internal_proc_a() call takes_array(return_array()) ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMsome_moduleEn_module) : !fir.ref @@ -187,7 +187,7 @@ subroutine host9() common /mycom/ n_common call internal_proc_a() contains -! CHECK-LABEL: func private @_QFhost9Pinternal_proc_a +! CHECK-LABEL: func @_QFhost9Pinternal_proc_a subroutine internal_proc_a() ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index ! CHECK: %[[VAL_1:.*]] = fir.address_of(@mycom_) : !fir.ref> @@ -213,7 +213,7 @@ subroutine host10() implicit none call internal_proc_a() contains -! CHECK-LABEL: func private @_QFhost10Pinternal_proc_a +! CHECK-LABEL: func @_QFhost10Pinternal_proc_a subroutine internal_proc_a() call takes_array(return_array()) ! CHECK: %[[VAL_0:.*]] = arith.constant 0 : index diff --git a/flang/test/Lower/forall/array-constructor.f90 b/flang/test/Lower/forall/array-constructor.f90 index ad21ed33fba2d4..083a71ba479aa2 100644 --- a/flang/test/Lower/forall/array-constructor.f90 +++ b/flang/test/Lower/forall/array-constructor.f90 @@ -114,8 +114,8 @@ end subroutine ac1 ! CHECK: return ! CHECK: } -! CHECK-LABEL: func private @_QFac1Pfunc( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.box> {fir.bindc_name = "a"}) -> i32 {{.*}} { +! CHECK-LABEL: func @_QFac1Pfunc( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.box> {fir.bindc_name = "a"}) -> i32 { ! CHECK: %[[VAL_1:.*]] = fir.alloca i32 {bindc_name = "func", uniq_name = "_QFac1FfuncEfunc"} ! CHECK: %[[VAL_2:.*]] = arith.constant 1 : i64 ! CHECK: %[[VAL_3:.*]] = arith.constant 1 : i64 @@ -259,8 +259,8 @@ end subroutine ac2 ! CHECK: return ! CHECK: } -! CHECK-LABEL: func private @_QFac2Pfunc( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.box> {fir.bindc_name = "a"}) -> !fir.array<3xi32> {{.*}} { +! CHECK-LABEL: func @_QFac2Pfunc( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.box> {fir.bindc_name = "a"}) -> !fir.array<3xi32> { ! CHECK: %[[VAL_1:.*]] = arith.constant 3 : index ! CHECK: %[[VAL_2:.*]] = fir.alloca !fir.array<3xi32> {bindc_name = "func", uniq_name = "_QFac2FfuncEfunc"} ! CHECK: %[[VAL_3:.*]] = fir.shape %[[VAL_1]] : (index) -> !fir.shape<1> diff --git a/flang/test/Lower/forall/character-1.f90 b/flang/test/Lower/forall/character-1.f90 index e97c3f36b0b10f..e5c40a16420a62 100644 --- a/flang/test/Lower/forall/character-1.f90 +++ b/flang/test/Lower/forall/character-1.f90 @@ -17,7 +17,7 @@ subroutine sub(x) end subroutine sub end program test -! CHECK-LABEL: define internal void @_QFPsub( +! CHECK-LABEL: define void @_QFPsub( ! CHECK-SAME: ptr %[[arg:.*]]) ! CHECK: %[[extent:.*]] = getelementptr { {{.*}}, [1 x [3 x i64]] }, ptr %[[arg]], i32 0, i32 7, i64 0, i32 1 ! CHECK: %[[extval:.*]] = load i64, ptr %[[extent]] diff --git a/flang/test/Lower/global-initialization.f90 b/flang/test/Lower/global-initialization.f90 index ff208ecc3c8978..dd60a6fd8b9f86 100644 --- a/flang/test/Lower/global-initialization.f90 +++ b/flang/test/Lower/global-initialization.f90 @@ -4,19 +4,16 @@ program bar ! CHECK: fir.address_of(@[[name1:.*]]my_data) integer, save :: my_data = 1 print *, my_data - call foo() - call foo2() - call foo3() contains -! CHECK-LABEL: func private @_QFPfoo +! CHECK-LABEL: func @_QFPfoo subroutine foo() ! CHECK: fir.address_of(@[[name2:.*foo.*my_data]]) integer, save :: my_data = 2 print *, my_data + 1 end subroutine -! CHECK-LABEL: func private @_QFPfoo2 +! CHECK-LABEL: func @_QFPfoo2 subroutine foo2() ! CHECK: fir.address_of(@[[name3:.*foo2.*my_data]]) integer, save :: my_data @@ -24,7 +21,7 @@ subroutine foo2() print *, my_data end subroutine -! CHECK-LABEL: func private @_QFPfoo3 +! CHECK-LABEL: func @_QFPfoo3 subroutine foo3() ! CHECK-DAG: fir.address_of(@[[name4:.*foo3.*idata]]){{.*}}fir.array<5xi32> ! CHECK-DAG: fir.address_of(@[[name5:.*foo3.*rdata]]){{.*}}fir.array<3xf16> diff --git a/flang/test/Lower/host-associated-functions.f90 b/flang/test/Lower/host-associated-functions.f90 index 78d081748c2f42..77a51490950fa1 100644 --- a/flang/test/Lower/host-associated-functions.f90 +++ b/flang/test/Lower/host-associated-functions.f90 @@ -19,8 +19,8 @@ subroutine capture_char_func_dummy(char_func_dummy, n) ! CHECK: fir.call @_QFcapture_char_func_dummyPinternal(%[[VAL_2]]) {{.*}}: (!fir.ref ()>, i64>, !fir.ref>>) -> () call internal() contains - ! CHECK-LABEL: func private @_QFcapture_char_func_dummyPinternal( - ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref ()>, i64>, !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFcapture_char_func_dummyPinternal( + ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref ()>, i64>, !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine internal() ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref ()>, i64>, !fir.ref>>, i32) -> !fir.ref ()>, i64>> @@ -55,8 +55,8 @@ subroutine capture_char_func_assumed_dummy(char_func_dummy) ! CHECK: fir.call @_QFcapture_char_func_assumed_dummyPinternal(%[[VAL_1]]) {{.*}}: (!fir.ref ()>, i64>>>) -> () call internal() contains -! CHECK-LABEL: func private @_QFcapture_char_func_assumed_dummyPinternal( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref ()>, i64>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFcapture_char_func_assumed_dummyPinternal( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref ()>, i64>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine internal() ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref ()>, i64>>>, i32) -> !fir.ref ()>, i64>> @@ -84,7 +84,7 @@ subroutine capture_char_func(n) ! CHECK: fir.call @_QFcapture_char_funcPinternal(%[[VAL_1]]) {{.*}}: (!fir.ref>>) -> () call internal() contains -! CHECK-LABEL: func private @_QFcapture_char_funcPinternal( +! CHECK-LABEL: func @_QFcapture_char_funcPinternal( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) subroutine internal() print *, char_func() @@ -109,8 +109,8 @@ function array_func() call internal() contains subroutine internal() -! CHECK-LABEL: func private @_QFcapture_array_funcPinternal( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFcapture_array_funcPinternal( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref>>, i32) -> !fir.llvm_ptr> ! CHECK: %[[VAL_3:.*]] = fir.load %[[VAL_2]] : !fir.llvm_ptr> @@ -146,7 +146,7 @@ subroutine use_module() ! CHECK: fir.call @_QFuse_modulePinternal() {{.*}}: () -> () call internal() contains -! CHECK-LABEL: func private @_QFuse_modulePinternal() {{.*}} { +! CHECK-LABEL: func @_QFuse_modulePinternal() { subroutine internal() print *, return_char(42) end subroutine diff --git a/flang/test/Lower/host-associated-globals.f90 b/flang/test/Lower/host-associated-globals.f90 index fe612e777aeaad..bb22a32775427d 100644 --- a/flang/test/Lower/host-associated-globals.f90 +++ b/flang/test/Lower/host-associated-globals.f90 @@ -18,7 +18,7 @@ subroutine bar() print *, j_in_equiv, not_in_equiv end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFmodule_varPbar() +! CHECK-LABEL: func.func @_QFmodule_varPbar() ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QMtest_mod_used_in_hostEi) : !fir.ref> ! CHECK: %[[VAL_1:.*]] = arith.constant 0 : index ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref>, index) -> !fir.ref @@ -37,7 +37,7 @@ subroutine bar() print *, j_in_equiv, not_in_equiv end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFtest_commonPbar() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QFtest_commonPbar() attributes {fir.internal_proc} { ! CHECK: %[[VAL_0:.*]] = fir.address_of(@x_) : !fir.ref> ! CHECK: %[[VAL_1:.*]] = fir.convert %[[VAL_0]] : (!fir.ref>) -> !fir.ref> ! CHECK: %[[VAL_2:.*]] = arith.constant 4 : index @@ -59,7 +59,7 @@ subroutine bar() print *, j_in_equiv, not_in_equiv end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFsaved_equivPbar() attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QFsaved_equivPbar() attributes {fir.internal_proc} { ! CHECK: %[[VAL_0:.*]] = fir.address_of(@_QFsaved_equivEi) : !fir.ref> ! CHECK: %[[VAL_1:.*]] = arith.constant 4 : index ! CHECK: %[[VAL_2:.*]] = fir.coordinate_of %[[VAL_0]], %[[VAL_1]] : (!fir.ref>, index) -> !fir.ref @@ -79,8 +79,8 @@ subroutine bar() call test(saved_j, j) end subroutine end subroutine -! CHECK-LABEL: func.func private @_QFmixed_capturePbar( -! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QFmixed_capturePbar( +! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[VAL_1:.*]] = fir.address_of(@_QFmixed_captureEsaved_i) : !fir.ref> ! CHECK: %[[VAL_2:.*]] = arith.constant 0 : index ! CHECK: %[[VAL_3:.*]] = fir.coordinate_of %[[VAL_1]], %[[VAL_2]] : (!fir.ref>, index) -> !fir.ref diff --git a/flang/test/Lower/host-associated.f90 b/flang/test/Lower/host-associated.f90 index f88903c8af80f8..25e637805e872b 100644 --- a/flang/test/Lower/host-associated.f90 +++ b/flang/test/Lower/host-associated.f90 @@ -19,8 +19,8 @@ subroutine test1 call test1_internal print *, i contains - ! CHECK-LABEL: func private @_QFtest1Ptest1_internal( - ! CHECK-SAME: %[[arg:[^:]*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest1Ptest1_internal( + ! CHECK-SAME: %[[arg:[^:]*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[iaddr:.*]] = fir.coordinate_of %[[arg]], %c0 ! CHECK: %[[i:.*]] = fir.load %[[iaddr]] : !fir.llvm_ptr> ! CHECK: %[[val:.*]] = fir.call @_QPifoo() {{.*}}: () -> i32 @@ -46,8 +46,8 @@ subroutine test2 call test2_internal print *, a, b contains - ! CHECK-LABEL: func private @_QFtest2Ptest2_internal( - ! CHECK-SAME: %[[arg:[^:]*]]: !fir.ref, !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest2Ptest2_internal( + ! CHECK-SAME: %[[arg:[^:]*]]: !fir.ref, !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test2_internal ! CHECK: %[[a:.*]] = fir.coordinate_of %[[arg]], %c0 ! CHECK: %[[aa:.*]] = fir.load %[[a]] : !fir.llvm_ptr> @@ -61,8 +61,8 @@ subroutine test2_internal call test2_inner end subroutine test2_internal - ! CHECK-LABEL: func private @_QFtest2Ptest2_inner( - ! CHECK-SAME: %[[arg:[^:]*]]: !fir.ref, !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest2Ptest2_inner( + ! CHECK-SAME: %[[arg:[^:]*]]: !fir.ref, !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test2_inner ! CHECK: %[[a:.*]] = fir.coordinate_of %[[arg]], %c0 ! CHECK: %[[aa:.*]] = fir.load %[[a]] : !fir.llvm_ptr> @@ -95,8 +95,8 @@ subroutine test6(c) print *, c contains - ! CHECK-LABEL: func private @_QFtest6Ptest6_inner( - ! CHECK-SAME: %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest6Ptest6_inner( + ! CHECK-SAME: %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test6_inner ! CHECK: %[[coor:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>>, i32) -> !fir.ref> ! CHECK: %[[load:.*]] = fir.load %[[coor]] : !fir.ref> @@ -137,8 +137,8 @@ subroutine test3(p,q,i) end if contains - ! CHECK-LABEL: func private @_QFtest3Ptest3_inner( - ! CHECK-SAME: %[[tup:.*]]: !fir.ref>, !fir.box>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest3Ptest3_inner( + ! CHECK-SAME: %[[tup:.*]]: !fir.ref>, !fir.box>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test3_inner ! CHECK: %[[pcoor:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>, !fir.box>>>, i32) -> !fir.ref>> ! CHECK: %[[p:.*]] = fir.load %[[pcoor]] : !fir.ref>> @@ -184,8 +184,8 @@ subroutine test3a(p) end if contains - ! CHECK: func private @_QFtest3aPtest3a_inner( - ! CHECK-SAME: %[[tup:.*]]: !fir.ref>, !fir.box>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK: func @_QFtest3aPtest3a_inner( + ! CHECK-SAME: %[[tup:.*]]: !fir.ref>, !fir.box>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test3a_inner ! CHECK: %[[pcoor:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>, !fir.box>>>, i32) -> !fir.ref>> ! CHECK: %[[p:.*]] = fir.load %[[pcoor]] : !fir.ref>> @@ -228,8 +228,8 @@ subroutine test4 end if contains - ! CHECK-LABEL: func private @_QFtest4Ptest4_inner( - ! CHECK-SAME:%[[tup:.*]]: !fir.ref>>, !fir.ref>>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest4Ptest4_inner( + ! CHECK-SAME:%[[tup:.*]]: !fir.ref>>, !fir.ref>>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test4_inner ! CHECK: %[[ptup:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>>, !fir.ref>>>>, i32) -> !fir.llvm_ptr>>> ! CHECK: %[[p:.*]] = fir.load %[[ptup]] : !fir.llvm_ptr>>> @@ -270,8 +270,8 @@ subroutine test5 end if contains - ! CHECK-LABEL: func private @_QFtest5Ptest5_inner( - ! CHECK-SAME:%[[tup:.*]]: !fir.ref>>>, !fir.ref>>>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { + ! CHECK-LABEL: func @_QFtest5Ptest5_inner( + ! CHECK-SAME:%[[tup:.*]]: !fir.ref>>>, !fir.ref>>>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine test5_inner ! CHECK: %[[ptup:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>>>, !fir.ref>>>>>, i32) -> !fir.llvm_ptr>>>> ! CHECK: %[[p:.*]] = fir.load %[[ptup]] : !fir.llvm_ptr>>>> @@ -308,8 +308,8 @@ subroutine test7(j, k) k = test7_inner(k) contains -! CHECK-LABEL: func private @_QFtest7Ptest7_inner( -! CHECK-SAME: %[[i:.*]]: !fir.ref{{.*}}, %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) -> i32 attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFtest7Ptest7_inner( +! CHECK-SAME: %[[i:.*]]: !fir.ref{{.*}}, %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) -> i32 attributes {fir.internal_proc} { elemental integer function test7_inner(i) implicit none integer, intent(in) :: i @@ -329,8 +329,8 @@ subroutine issue990() integer :: captured call bar() contains -! CHECK-LABEL: func private @_QFissue990Pbar( -! CHECK-SAME: %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFissue990Pbar( +! CHECK-SAME: %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine bar() integer :: stmt_func, i stmt_func(i) = i + captured @@ -351,8 +351,8 @@ subroutine issue990b() captured_stmt_func(i) = i + captured call bar() contains -! CHECK-LABEL: func private @_QFissue990bPbar( -! CHECK-SAME: %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFissue990bPbar( +! CHECK-SAME: %[[tup:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine bar() ! CHECK: %[[tupAddr:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>>, i32) -> !fir.llvm_ptr> ! CHECK: %[[addr:.*]] = fir.load %[[tupAddr]] : !fir.llvm_ptr> @@ -372,8 +372,8 @@ real function dummy_proc(x) end interface call bar() contains -! CHECK-LABEL: func private @_QFtest8Pbar( -! CHECK-SAME: %[[tup:.*]]: !fir.ref ()>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFtest8Pbar( +! CHECK-SAME: %[[tup:.*]]: !fir.ref ()>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine bar() ! CHECK: %[[tupAddr:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref ()>>>, i32) -> !fir.ref ()>> ! CHECK: %[[dummyProc:.*]] = fir.load %[[tupAddr]] : !fir.ref ()>> @@ -392,8 +392,8 @@ subroutine dummy_proc() end interface call bar() contains -! CHECK-LABEL: func private @_QFtest9Pbar( -! CHECK-SAME: %[[tup:.*]]: !fir.ref ()>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFtest9Pbar( +! CHECK-SAME: %[[tup:.*]]: !fir.ref ()>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine bar() ! CHECK: %[[tupAddr:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref ()>>>, i32) -> !fir.ref ()>> ! CHECK: %[[dummyProc:.*]] = fir.load %[[tupAddr]] : !fir.ref ()>> @@ -415,8 +415,8 @@ subroutine test10(i) ! CHECK: fir.call @_QFtest10Pbar(%[[tup]]) {{.*}}: (!fir.ref>>>>>) -> () call bar() contains -! CHECK-LABEL: func private @_QFtest10Pbar( -! CHECK-SAME: %[[tup:.*]]: !fir.ref>>>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func @_QFtest10Pbar( +! CHECK-SAME: %[[tup:.*]]: !fir.ref>>>>> {fir.host_assoc}) attributes {fir.internal_proc} { subroutine bar() ! CHECK: %[[tupAddr:.*]] = fir.coordinate_of %[[tup]], %c0{{.*}} : (!fir.ref>>>>>, i32) -> !fir.llvm_ptr>>>> ! CHECK: fir.load %[[tupAddr]] : !fir.llvm_ptr>>>> @@ -433,9 +433,9 @@ subroutine bar() ! CHECK: %[[VAL_8:.*]] = fir.emboxproc %[[VAL_7]], %[[VAL_5]] : ((!fir.ref, !fir.ref>>) -> (), !fir.ref>>) -> !fir.boxproc<() -> ()> ! CHECK: fir.call @_QPtest_proc_dummy_other(%[[VAL_8]]) {{.*}}: (!fir.boxproc<() -> ()>) -> () -! CHECK-LABEL: func private @_QFtest_proc_dummyPtest_proc_dummy_a( +! CHECK-LABEL: func @_QFtest_proc_dummyPtest_proc_dummy_a( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref {fir.bindc_name = "j"}, -! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-SAME: %[[VAL_1:.*]]: !fir.ref>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[VAL_2:.*]] = arith.constant 0 : i32 ! CHECK: %[[VAL_3:.*]] = fir.coordinate_of %[[VAL_1]], %[[VAL_2]] : (!fir.ref>>, i32) -> !fir.llvm_ptr> ! CHECK: %[[VAL_4:.*]] = fir.load %[[VAL_3]] : !fir.llvm_ptr> @@ -525,10 +525,10 @@ end subroutine test_proc_dummy_other ! CHECK: return ! CHECK: } -! CHECK-LABEL: func private @_QFtest_proc_dummy_charPgen_message( +! CHECK-LABEL: func @_QFtest_proc_dummy_charPgen_message( ! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref>, ! CHECK-SAME: %[[VAL_1:.*]]: index, -! CHECK-SAME: %[[VAL_2:.*]]: !fir.ref>> {fir.host_assoc}) -> !fir.boxchar<1> attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-SAME: %[[VAL_2:.*]]: !fir.ref>> {fir.host_assoc}) -> !fir.boxchar<1> attributes {fir.internal_proc} { ! CHECK-DAG: %[[VAL_3:.*]] = arith.constant 0 : i32 ! CHECK-DAG: %[[VAL_4:.*]] = arith.constant 10 : index ! CHECK-DAG: %[[VAL_5:.*]] = arith.constant false diff --git a/flang/test/Lower/module-and-internal-proc.f90 b/flang/test/Lower/module-and-internal-proc.f90 index 0f4c6809581cfc..1da5ce42293974 100644 --- a/flang/test/Lower/module-and-internal-proc.f90 +++ b/flang/test/Lower/module-and-internal-proc.f90 @@ -17,7 +17,7 @@ subroutine test1() subroutine test2() call test2internal() contains - ! CHECK-LABEL: func private @_QMparentFtest2Ptest2internal() + ! CHECK-LABEL: func @_QMparentFtest2Ptest2internal() subroutine test2internal() ! CHECK: fir.address_of(@_QMparentEi) : !fir.ref print *, i @@ -31,7 +31,7 @@ subroutine test3() use parent call test3internal() contains - ! CHECK-LABEL: func private @_QFtest3Ptest3internal() + ! CHECK-LABEL: func @_QFtest3Ptest3internal() subroutine test3internal() ! CHECK: fir.address_of(@_QMparentEi) : !fir.ref print *, i diff --git a/flang/test/Lower/parent-component.f90 b/flang/test/Lower/parent-component.f90 index c6bc53340643fc..ed1130a08493e2 100644 --- a/flang/test/Lower/parent-component.f90 +++ b/flang/test/Lower/parent-component.f90 @@ -29,20 +29,20 @@ subroutine print_scalar(a) type(p), intent(in) :: a print*, a end subroutine - ! CHECK-LABEL: func.func private @_QFPprint_scalar(%{{.*}}: !fir.ref> {fir.bindc_name = "a"}) + ! CHECK-LABEL: func.func @_QFPprint_scalar(%{{.*}}: !fir.ref> {fir.bindc_name = "a"}) subroutine print_p(a) type(p), intent(in) :: a(2) print*, a end subroutine - ! CHECK-LABEL: func.func private @_QFPprint_p(%{{.*}}: !fir.ref>> {fir.bindc_name = "a"}) + ! CHECK-LABEL: func.func @_QFPprint_p(%{{.*}}: !fir.ref>> {fir.bindc_name = "a"}) subroutine init_with_slice() type(c) :: y(2) = [ c(11, 21), c(12, 22) ] call print_p(y(:)%p) print*,y(:)%p end subroutine - ! CHECK-LABEL: func.func private @_QFPinit_with_slice() + ! CHECK-LABEL: func.func @_QFPinit_with_slice() ! CHECK: %[[Y:.*]] = fir.address_of(@_QFFinit_with_sliceEy) : !fir.ref>> ! CHECK: %[[C2:.*]] = arith.constant 2 : index ! CHECK: %[[C1:.*]] = arith.constant 1 : index @@ -78,7 +78,7 @@ subroutine init_no_slice() call print_p(y%p) print*,y%p end subroutine - ! CHECK-LABEL: func.func private @_QFPinit_no_slice() + ! CHECK-LABEL: func.func @_QFPinit_no_slice() ! CHECK: %[[Y:.*]] = fir.address_of(@_QFFinit_no_sliceEy) : !fir.ref>> ! CHECK: %[[C2:.*]] = arith.constant 2 : index ! CHECK: %[[SHAPE:.*]] = fir.shape %[[C2]] : (index) -> !fir.shape<1> @@ -106,7 +106,7 @@ subroutine init_allocatable() print*,y%p end subroutine - ! CHECK-LABEL: func.func private @_QFPinit_allocatable() + ! CHECK-LABEL: func.func @_QFPinit_allocatable() ! CHECK: %[[ALLOC:.*]] = fir.alloca !fir.heap>> {uniq_name = "_QFFinit_allocatableEy.addr"} ! CHECK: %[[LB0:.*]] = fir.alloca index {uniq_name = "_QFFinit_allocatableEy.lb0"} ! CHECK: %[[EXT0:.*]] = fir.alloca index {uniq_name = "_QFFinit_allocatableEy.ext0"} @@ -139,7 +139,7 @@ subroutine init_scalar() print*,s%p end subroutine - ! CHECK-LABEL: func.func private @_QFPinit_scalar() + ! CHECK-LABEL: func.func @_QFPinit_scalar() ! CHECK: %[[S:.*]] = fir.address_of(@_QFFinit_scalarEs) : !fir.ref> ! CHECK: %[[CAST:.*]] = fir.convert %[[S]] : (!fir.ref>) -> !fir.ref> ! CHECK: fir.call @_QFPprint_scalar(%[[CAST]]) {{.*}}: (!fir.ref>) -> () @@ -154,7 +154,7 @@ subroutine init_assumed(y) print*,y%p end subroutine - ! CHECK-LABEL: func.func private @_QFPinit_assumed( + ! CHECK-LABEL: func.func @_QFPinit_assumed( ! CHECK-SAME: %[[ARG0:.*]]: !fir.box> ! CHECK: %[[BOX:.*]] = fir.rebox %[[ARG0]] : (!fir.box>>) -> !fir.box>> @@ -167,7 +167,7 @@ subroutine init_existing_field() call print_p(y%c%p) end subroutine - ! CHECK-LABEL: func.func private @_QFPinit_existing_field + ! CHECK-LABEL: func.func @_QFPinit_existing_field ! CHECK: %[[C2:.*]] = arith.constant 2 : index ! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.array<2x!fir.type<_QFTz{k:i32,c:!fir.type<_QFTc{a:i32,b:i32}>}>> {bindc_name = "y", uniq_name = "_QFFinit_existing_fieldEy"} ! CHECK: %[[FIELD_C:.*]] = fir.field_index c, !fir.type<_QFTz{k:i32,c:!fir.type<_QFTc{a:i32,b:i32}>}> @@ -183,7 +183,7 @@ subroutine parent_comp_lhs() a%p = B end subroutine -! CHECK-LABEL: func.func private @_QFPparent_comp_lhs() +! CHECK-LABEL: func.func @_QFPparent_comp_lhs() ! CHECK: %[[BOX:.*]] = fir.alloca !fir.box> ! CHECK: %[[A:.*]] = fir.alloca !fir.type<_QFTc{a:i32,b:i32}> {bindc_name = "a", uniq_name = "_QFFparent_comp_lhsEa"} ! CHECK: %[[B:.*]] = fir.alloca !fir.type<_QFTp{a:i32}> {bindc_name = "b", uniq_name = "_QFFparent_comp_lhsEb"} diff --git a/flang/test/Lower/polymorphic.f90 b/flang/test/Lower/polymorphic.f90 index e031b4805dc5b1..06ee558b1397f0 100644 --- a/flang/test/Lower/polymorphic.f90 +++ b/flang/test/Lower/polymorphic.f90 @@ -519,8 +519,8 @@ subroutine internal end subroutine end subroutine -! CHECK-LABEL: func.func private @_QMpolymorphic_testFhost_assocPinternal( -! CHECK-SAME: %[[TUPLE:.*]]: !fir.ref>>> {fir.host_assoc}) attributes {fir.internal_proc, llvm.linkage = #llvm.linkage} { +! CHECK-LABEL: func.func @_QMpolymorphic_testFhost_assocPinternal( +! CHECK-SAME: %[[TUPLE:.*]]: !fir.ref>>> {fir.host_assoc}) attributes {fir.internal_proc} { ! CHECK: %[[POS_IN_TUPLE:.*]] = arith.constant 0 : i32 ! CHECK: %[[COORD_OF_CLASS:.*]] = fir.coordinate_of %[[TUPLE]], %[[POS_IN_TUPLE]] : (!fir.ref>>>, i32) -> !fir.ref>> ! CHECK: %[[CLASS:.*]] = fir.load %[[COORD_OF_CLASS]] : !fir.ref>> diff --git a/flang/test/Lower/program-units-fir-mangling.f90 b/flang/test/Lower/program-units-fir-mangling.f90 index 002343c45f6ec7..36631979141a08 100644 --- a/flang/test/Lower/program-units-fir-mangling.f90 +++ b/flang/test/Lower/program-units-fir-mangling.f90 @@ -44,12 +44,12 @@ function foo() function foo2() real(4) :: foo2 contains - ! CHECK-LABEL: func private @_QFfoo2Psub() {{.*}} { + ! CHECK-LABEL: func @_QFfoo2Psub() { subroutine sub() ! CHECK: } end subroutine - ! CHECK-LABEL: func private @_QFfoo2Pfoo() {{.*}} { + ! CHECK-LABEL: func @_QFfoo2Pfoo() { subroutine foo() ! CHECK: } end subroutine @@ -58,12 +58,12 @@ subroutine foo() ! CHECK-LABEL: func @_QPsub2() subroutine sUb2() contains - ! CHECK-LABEL: func private @_QFsub2Psub() {{.*}} { + ! CHECK-LABEL: func @_QFsub2Psub() { subroutine sub() ! CHECK: } end subroutine - ! CHECK-LABEL: func private @_QFsub2Pfoo() {{.*}} { + ! CHECK-LABEL: func @_QFsub2Pfoo() { subroutine Foo() ! CHECK: } end subroutine @@ -74,7 +74,7 @@ module testMod2 ! CHECK-LABEL: func @_QMtestmod2Psub() subroutine sub() contains - ! CHECK-LABEL: func private @_QMtestmod2FsubPsubsub() {{.*}} { + ! CHECK-LABEL: func @_QMtestmod2FsubPsubsub() { subroutine subSub() ! CHECK: } end subroutine @@ -105,7 +105,7 @@ subroutine sub ! CHECK-LABEL: func @_QMcolor_pointsScolor_points_aSimplPfoo() subroutine foo contains - ! CHECK-LABEL: func private @_QMcolor_pointsScolor_points_aSimplFfooPbar() {{.*}} { + ! CHECK-LABEL: func @_QMcolor_pointsScolor_points_aSimplFfooPbar() { subroutine bar ! CHECK: } end subroutine @@ -128,7 +128,7 @@ subroutine should_not_collide() program test ! CHECK: } contains -! CHECK-LABEL: func private @_QFPshould_not_collide() {{.*}} { +! CHECK-LABEL: func @_QFPshould_not_collide() { subroutine should_not_collide() ! CHECK: } end subroutine @@ -226,7 +226,7 @@ subroutine nest1 ! CHECK: fir.call @_QFnest1Pinner() call inner contains - ! CHECK-LABEL: func private @_QFnest1Pinner + ! CHECK-LABEL: func @_QFnest1Pinner subroutine inner ! CHECK: %[[V_0:[0-9]+]] = fir.address_of(@_QFnest1FinnerEkk) : !fir.ref integer, save :: kk = 1 @@ -239,7 +239,7 @@ subroutine nest2 ! CHECK: fir.call @_QFnest2Pinner() call inner contains - ! CHECK-LABEL: func private @_QFnest2Pinner + ! CHECK-LABEL: func @_QFnest2Pinner subroutine inner ! CHECK: %[[V_0:[0-9]+]] = fir.address_of(@_QFnest2FinnerEkk) : !fir.ref integer, save :: kk = 77