llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-flang-openmp Author: Joseph Huber (jhuber6) <details> <summary>Changes</summary> Summary: Currently, OpenMP handles the `omp requires` clause by emitting a global constructor into the runtime for every translation unit that requires it. However, this is not a great solution because it prevents us from having a defined order in which the runtime is accessed and used. This patch changes the approach to no longer use global constructors, but to instead group the flag with the other offloading entires that we already handle. This has the effect of still registering each flag per requires TU, but now we have a single constructor that handles everything. This function removes support for the old `__tgt_register_requires` and replaces it with a warning message. We just had a recent release, and the OpenMP policy for the past four releases since we switched to LLVM is that we do not provide strict backwards compatibility between major LLVM releases now that the library is versioned. This means that a user will need to recompile if they have an old binary that relied on `register_requires` having the old behavior. It is important that we actively deprecate this, as otherwise it would not solve the problem of having no defined init and shutdown order for `libomptarget`. The problem of `libomptarget` not having a define init and shutdown order cascades into a lot of other issues so I have a strong incentive to be rid of it. It is worth noting that the current `__tgt_offload_entry` only has space for a 32-bit integer here. I am planning to overhaul these at some point as well. --- Patch is 2.09 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/80460.diff 173 Files Affected: - (modified) clang/lib/CodeGen/CGOpenMPRuntime.cpp (-38) - (modified) clang/lib/CodeGen/CGOpenMPRuntime.h (-4) - (modified) clang/lib/CodeGen/CodeGenModule.cpp (-4) - (modified) clang/test/OpenMP/bug60602.cpp (-7) - (modified) clang/test/OpenMP/distribute_codegen.cpp (-14) - (modified) clang/test/OpenMP/distribute_firstprivate_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/distribute_lastprivate_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/distribute_parallel_for_codegen.cpp (-28) - (modified) clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp (-7) - (modified) clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp (+252-280) - (modified) clang/test/OpenMP/distribute_parallel_for_private_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/distribute_parallel_for_proc_bind_codegen.cpp (-7) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_codegen.cpp (-28) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_firstprivate_codegen.cpp (+16-44) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_if_codegen.cpp (-28) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_lastprivate_codegen.cpp (+24-52) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp (+308-336) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_private_codegen.cpp (-28) - (modified) clang/test/OpenMP/distribute_parallel_for_simd_proc_bind_codegen.cpp (-7) - (modified) clang/test/OpenMP/distribute_private_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/distribute_simd_codegen.cpp (+18-46) - (modified) clang/test/OpenMP/distribute_simd_firstprivate_codegen.cpp (+16-44) - (modified) clang/test/OpenMP/distribute_simd_lastprivate_codegen.cpp (+24-52) - (modified) clang/test/OpenMP/distribute_simd_private_codegen.cpp (-28) - (modified) clang/test/OpenMP/distribute_simd_reduction_codegen.cpp (-21) - (modified) clang/test/OpenMP/map_struct_ordering.cpp (-7) - (modified) clang/test/OpenMP/nvptx_lambda_capturing.cpp (+18-25) - (modified) clang/test/OpenMP/openmp_offload_registration.cpp (-9) - (modified) clang/test/OpenMP/reduction_implicit_map.cpp (+14-28) - (modified) clang/test/OpenMP/target_codegen.cpp (-8) - (modified) clang/test/OpenMP/target_codegen_global_capture.cpp (-14) - (modified) clang/test/OpenMP/target_codegen_registration.cpp (+26-28) - (modified) clang/test/OpenMP/target_depend_codegen.cpp (-8) - (modified) clang/test/OpenMP/target_firstprivate_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_has_device_addr_codegen.cpp (+9-16) - (modified) clang/test/OpenMP/target_has_device_addr_codegen_01.cpp (+6-13) - (modified) clang/test/OpenMP/target_is_device_ptr_codegen.cpp (+40-124) - (modified) clang/test/OpenMP/target_map_codegen_03.cpp (-14) - (modified) clang/test/OpenMP/target_map_codegen_hold.cpp (-28) - (modified) clang/test/OpenMP/target_map_deref_array_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_map_member_expr_codegen.cpp (+10-17) - (modified) clang/test/OpenMP/target_offload_mandatory_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_ompx_dyn_cgroup_mem_codegen.cpp (+54-68) - (modified) clang/test/OpenMP/target_parallel_codegen.cpp (+40-54) - (modified) clang/test/OpenMP/target_parallel_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_parallel_depend_codegen.cpp (-8) - (modified) clang/test/OpenMP/target_parallel_for_codegen.cpp (+128-156) - (modified) clang/test/OpenMP/target_parallel_for_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_parallel_for_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_parallel_for_simd_codegen.cpp (+98-126) - (modified) clang/test/OpenMP/target_parallel_for_simd_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_parallel_for_simd_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_parallel_generic_loop_codegen-1.cpp (+52-73) - (modified) clang/test/OpenMP/target_parallel_generic_loop_codegen-2.cpp (-14) - (modified) clang/test/OpenMP/target_parallel_generic_loop_depend_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_parallel_generic_loop_uses_allocators_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_parallel_if_codegen.cpp (-14) - (modified) clang/test/OpenMP/target_parallel_num_threads_codegen.cpp (-14) - (modified) clang/test/OpenMP/target_simd_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_simd_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_simd_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_task_affinity_codegen.cpp (+64-78) - (modified) clang/test/OpenMP/target_teams_codegen.cpp (-14) - (modified) clang/test/OpenMP/target_teams_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_teams_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_teams_distribute_codegen.cpp (+64-78) - (modified) clang/test/OpenMP/target_teams_distribute_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_teams_distribute_collapse_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_teams_distribute_dist_schedule_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_firstprivate_codegen.cpp (+4-25) - (modified) clang/test/OpenMP/target_teams_distribute_lastprivate_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_codegen.cpp (-14) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_collapse_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_dist_schedule_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_firstprivate_codegen.cpp (+5-26) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_if_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_lastprivate_codegen.cpp (+2-30) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_order_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_private_codegen.cpp (+5-26) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_proc_bind_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_reduction_codegen.cpp (+20-41) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_schedule_codegen.cpp (-56) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen.cpp (-14) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_collapse_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_firstprivate_codegen.cpp (+7-28) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_if_codegen.cpp (+6-34) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_lastprivate_codegen.cpp (+24-52) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_private_codegen.cpp (-21) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_proc_bind_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_reduction_codegen.cpp (+20-41) - (modified) clang/test/OpenMP/target_teams_distribute_parallel_for_simd_schedule_codegen.cpp (-56) - (modified) clang/test/OpenMP/target_teams_distribute_private_codegen.cpp (+4-25) - (modified) clang/test/OpenMP/target_teams_distribute_reduction_codegen.cpp (+100-121) - (modified) clang/test/OpenMP/target_teams_distribute_simd_codegen.cpp (+140-168) - (modified) clang/test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp (+2-2) - (modified) clang/test/OpenMP/target_teams_distribute_simd_collapse_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp (-4) - (modified) clang/test/OpenMP/target_teams_distribute_simd_dist_schedule_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_distribute_simd_firstprivate_codegen.cpp (+6-27) - (modified) clang/test/OpenMP/target_teams_distribute_simd_lastprivate_codegen.cpp (+24-52) - (modified) clang/test/OpenMP/target_teams_distribute_simd_private_codegen.cpp (-21) - (modified) clang/test/OpenMP/target_teams_distribute_simd_reduction_codegen.cpp (+10-31) - (modified) clang/test/OpenMP/target_teams_generic_loop_codegen-1.cpp (-14) - (modified) clang/test/OpenMP/target_teams_generic_loop_collapse_codegen.cpp (-28) - (modified) clang/test/OpenMP/target_teams_generic_loop_depend_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_generic_loop_if_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_generic_loop_order_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_generic_loop_private_codegen.cpp (+5-26) - (modified) clang/test/OpenMP/target_teams_generic_loop_reduction_codegen.cpp (+20-41) - (modified) clang/test/OpenMP/target_teams_generic_loop_uses_allocators_codegen.cpp (-7) - (modified) clang/test/OpenMP/target_teams_map_codegen.cpp (+32-46) - (modified) clang/test/OpenMP/target_teams_num_teams_codegen.cpp (-14) - (modified) clang/test/OpenMP/target_teams_thread_limit_codegen.cpp (-14) - (modified) clang/test/OpenMP/teams_codegen.cpp (-42) - (modified) clang/test/OpenMP/teams_distribute_codegen.cpp (+22-78) - (modified) clang/test/OpenMP/teams_distribute_collapse_codegen.cpp (+14-42) - (modified) clang/test/OpenMP/teams_distribute_dist_schedule_codegen.cpp (+38-66) - (modified) clang/test/OpenMP/teams_distribute_firstprivate_codegen.cpp (+8-29) - (modified) clang/test/OpenMP/teams_distribute_lastprivate_codegen.cpp (+32-60) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_codegen.cpp (+30-86) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_collapse_codegen.cpp (+20-48) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_copyin_codegen.cpp (+19-40) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_dist_schedule_codegen.cpp (+56-84) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_firstprivate_codegen.cpp (+13-34) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_if_codegen.cpp (+30-37) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_lastprivate_codegen.cpp (+46-74) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_num_threads_codegen.cpp (+124-138) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_private_codegen.cpp (+13-34) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_proc_bind_codegen.cpp (+10-17) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_reduction_codegen.cpp (+46-67) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_schedule_codegen.cpp (+184-240) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_codegen.cpp (+30-86) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_collapse_codegen.cpp (+20-48) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_dist_schedule_codegen.cpp (+56-84) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_firstprivate_codegen.cpp (+15-36) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_if_codegen.cpp (+124-152) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_lastprivate_codegen.cpp (+68-96) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_num_threads_codegen.cpp (+150-164) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_private_codegen.cpp (-21) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_proc_bind_codegen.cpp (+10-17) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_reduction_codegen.cpp (+46-67) - (modified) clang/test/OpenMP/teams_distribute_parallel_for_simd_schedule_codegen.cpp (+184-240) - (modified) clang/test/OpenMP/teams_distribute_private_codegen.cpp (+8-29) - (modified) clang/test/OpenMP/teams_distribute_reduction_codegen.cpp (+26-47) - (modified) clang/test/OpenMP/teams_distribute_simd_codegen.cpp (+4-88) - (modified) clang/test/OpenMP/teams_distribute_simd_collapse_codegen.cpp (+14-42) - (modified) clang/test/OpenMP/teams_distribute_simd_dist_schedule_codegen.cpp (+38-66) - (modified) clang/test/OpenMP/teams_distribute_simd_firstprivate_codegen.cpp (+10-31) - (modified) clang/test/OpenMP/teams_distribute_simd_lastprivate_codegen.cpp (+54-82) - (modified) clang/test/OpenMP/teams_distribute_simd_private_codegen.cpp (-21) - (modified) clang/test/OpenMP/teams_distribute_simd_reduction_codegen.cpp (+26-47) - (modified) clang/test/OpenMP/teams_firstprivate_codegen.cpp (+62-104) - (modified) clang/test/OpenMP/teams_generic_loop_codegen-1.cpp (+30-86) - (modified) clang/test/OpenMP/teams_generic_loop_collapse_codegen.cpp (+20-48) - (modified) clang/test/OpenMP/teams_generic_loop_private_codegen.cpp (+13-34) - (modified) clang/test/OpenMP/teams_generic_loop_reduction_codegen.cpp (+46-67) - (modified) clang/test/OpenMP/teams_private_codegen.cpp (+54-82) - (modified) llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h (+2-10) - (modified) llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp (+11-29) - (modified) llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp (-40) - (modified) openmp/libomptarget/include/Shared/APITypes.h (+1-1) - (modified) openmp/libomptarget/include/omptarget.h (+3-1) - (modified) openmp/libomptarget/src/PluginManager.cpp (+6) - (modified) openmp/libomptarget/src/interface.cpp (+3-1) - (modified) openmp/libomptarget/src/omptarget.cpp (+1-1) - (modified) openmp/libomptarget/test/offloading/requires.c (+36-3) ``````````diff diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 4855e7410a015..a7b72df6d9f89 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -10100,44 +10100,6 @@ bool CGOpenMPRuntime::markAsGlobalTarget(GlobalDecl GD) { return !AlreadyEmittedTargetDecls.insert(D).second; } -llvm::Function *CGOpenMPRuntime::emitRequiresDirectiveRegFun() { - // If we don't have entries or if we are emitting code for the device, we - // don't need to do anything. - if (CGM.getLangOpts().OMPTargetTriples.empty() || - CGM.getLangOpts().OpenMPSimd || CGM.getLangOpts().OpenMPIsTargetDevice || - (OMPBuilder.OffloadInfoManager.empty() && - !HasEmittedDeclareTargetRegion && !HasEmittedTargetRegion)) - return nullptr; - - // Create and register the function that handles the requires directives. - ASTContext &C = CGM.getContext(); - - llvm::Function *RequiresRegFn; - { - CodeGenFunction CGF(CGM); - const auto &FI = CGM.getTypes().arrangeNullaryFunction(); - llvm::FunctionType *FTy = CGM.getTypes().GetFunctionType(FI); - std::string ReqName = getName({"omp_offloading", "requires_reg"}); - RequiresRegFn = CGM.CreateGlobalInitOrCleanUpFunction(FTy, ReqName, FI); - CGF.StartFunction(GlobalDecl(), C.VoidTy, RequiresRegFn, FI, {}); - // TODO: check for other requires clauses. - // The requires directive takes effect only when a target region is - // present in the compilation unit. Otherwise it is ignored and not - // passed to the runtime. This avoids the runtime from throwing an error - // for mismatching requires clauses across compilation units that don't - // contain at least 1 target region. - assert((HasEmittedTargetRegion || HasEmittedDeclareTargetRegion || - !OMPBuilder.OffloadInfoManager.empty()) && - "Target or declare target region expected."); - CGF.EmitRuntimeCall(OMPBuilder.getOrCreateRuntimeFunction( - CGM.getModule(), OMPRTL___tgt_register_requires), - llvm::ConstantInt::get( - CGM.Int64Ty, OMPBuilder.Config.getRequiresFlags())); - CGF.FinishFunction(); - } - return RequiresRegFn; -} - void CGOpenMPRuntime::emitTeamsCall(CodeGenFunction &CGF, const OMPExecutableDirective &D, SourceLocation Loc, diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index b01b39abd1606..c3206427b143e 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/lib/CodeGen/CGOpenMPRuntime.h @@ -1407,10 +1407,6 @@ class CGOpenMPRuntime { /// \param GD Global to scan. virtual bool emitTargetGlobal(GlobalDecl GD); - /// Creates and returns a registration function for when at least one - /// requires directives was used in the current module. - llvm::Function *emitRequiresDirectiveRegFun(); - /// Creates all the offload entries in the current compilation unit /// along with the associated metadata. void createOffloadEntriesAndInfoMetadata(); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c63e4ecc3dcba..d6d75efbbb2a8 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -836,10 +836,6 @@ void CodeGenModule::Release() { AddGlobalCtor(CudaCtorFunction); } if (OpenMPRuntime) { - if (llvm::Function *OpenMPRequiresDirectiveRegFun = - OpenMPRuntime->emitRequiresDirectiveRegFun()) { - AddGlobalCtor(OpenMPRequiresDirectiveRegFun, 0); - } OpenMPRuntime->createOffloadEntriesAndInfoMetadata(); OpenMPRuntime->clear(); } diff --git a/clang/test/OpenMP/bug60602.cpp b/clang/test/OpenMP/bug60602.cpp index 2fbfdfde07a0c..3ecc70cab778a 100644 --- a/clang/test/OpenMP/bug60602.cpp +++ b/clang/test/OpenMP/bug60602.cpp @@ -569,10 +569,3 @@ int kernel_within_loop(int *a, int *b, int N, int num_iters) { // CHECK: omp.precond.end: // CHECK-NEXT: ret void // -// -// CHECK-LABEL: define internal void @.omp_offloading.requires_reg -// CHECK-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK-NEXT: entry: -// CHECK-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_codegen.cpp b/clang/test/OpenMP/distribute_codegen.cpp index e3b43002a0518..31ec6ff911905 100644 --- a/clang/test/OpenMP/distribute_codegen.cpp +++ b/clang/test/OpenMP/distribute_codegen.cpp @@ -1037,13 +1037,6 @@ int fint(void) { return ftemplate<int>(); } // CHECK1-NEXT: ret void // // -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR3:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// -// // CHECK3-LABEL: define {{[^@]+}}@_Z23without_schedule_clausePfS_S_S_ // CHECK3-SAME: (ptr noundef [[A:%.*]], ptr noundef [[B:%.*]], ptr noundef [[C:%.*]], ptr noundef [[D:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: @@ -1953,13 +1946,6 @@ int fint(void) { return ftemplate<int>(); } // CHECK3-NEXT: ret void // // -// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK3-SAME: () #[[ATTR3:[0-9]+]] { -// CHECK3-NEXT: entry: -// CHECK3-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK3-NEXT: ret void -// -// // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z23without_schedule_clausePfS_S_S__l56 // CHECK17-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], ptr noundef [[A:%.*]], ptr noundef [[B:%.*]], ptr noundef [[C:%.*]], ptr noundef [[D:%.*]]) #[[ATTR0:[0-9]+]] { // CHECK17-NEXT: entry: diff --git a/clang/test/OpenMP/distribute_firstprivate_codegen.cpp b/clang/test/OpenMP/distribute_firstprivate_codegen.cpp index 361e26bc2984c..800a002e43968 100644 --- a/clang/test/OpenMP/distribute_firstprivate_codegen.cpp +++ b/clang/test/OpenMP/distribute_firstprivate_codegen.cpp @@ -304,13 +304,6 @@ int main() { // CHECK1-NEXT: ret void // // -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// -// // CHECK3-LABEL: define {{[^@]+}}@main // CHECK3-SAME: () #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: @@ -476,13 +469,6 @@ int main() { // CHECK3-NEXT: ret void // // -// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK3-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK3-NEXT: entry: -// CHECK3-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK3-NEXT: ret void -// -// // CHECK9-LABEL: define {{[^@]+}}@main // CHECK9-SAME: () #[[ATTR0:[0-9]+]] { // CHECK9-NEXT: entry: @@ -794,7 +780,7 @@ int main() { // // // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK9-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK9-SAME: () #[[ATTR1]] comdat { // CHECK9-NEXT: entry: // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -1148,13 +1134,6 @@ int main() { // CHECK9-NEXT: ret void // // -// CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK9-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK9-NEXT: entry: -// CHECK9-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK9-NEXT: ret void -// -// // CHECK11-LABEL: define {{[^@]+}}@main // CHECK11-SAME: () #[[ATTR0:[0-9]+]] { // CHECK11-NEXT: entry: @@ -1464,7 +1443,7 @@ int main() { // // // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK11-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK11-SAME: () #[[ATTR1]] comdat { // CHECK11-NEXT: entry: // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -1815,10 +1794,3 @@ int main() { // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4 // CHECK11-NEXT: ret void // -// -// CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK11-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK11-NEXT: entry: -// CHECK11-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK11-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_lastprivate_codegen.cpp b/clang/test/OpenMP/distribute_lastprivate_codegen.cpp index e005de30e14d1..772372076e947 100644 --- a/clang/test/OpenMP/distribute_lastprivate_codegen.cpp +++ b/clang/test/OpenMP/distribute_lastprivate_codegen.cpp @@ -291,13 +291,6 @@ int main() { // CHECK1-NEXT: ret void // // -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// -// // CHECK3-LABEL: define {{[^@]+}}@main // CHECK3-SAME: () #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: @@ -460,13 +453,6 @@ int main() { // CHECK3-NEXT: ret void // // -// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK3-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK3-NEXT: entry: -// CHECK3-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK3-NEXT: ret void -// -// // CHECK9-LABEL: define {{[^@]+}}@main // CHECK9-SAME: () #[[ATTR0:[0-9]+]] { // CHECK9-NEXT: entry: @@ -797,7 +783,7 @@ int main() { // // // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK9-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK9-SAME: () #[[ATTR1]] comdat { // CHECK9-NEXT: entry: // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -1169,13 +1155,6 @@ int main() { // CHECK9-NEXT: ret void // // -// CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK9-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK9-NEXT: entry: -// CHECK9-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK9-NEXT: ret void -// -// // CHECK11-LABEL: define {{[^@]+}}@main // CHECK11-SAME: () #[[ATTR0:[0-9]+]] { // CHECK11-NEXT: entry: @@ -1504,7 +1483,7 @@ int main() { // // // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK11-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK11-SAME: () #[[ATTR1]] comdat { // CHECK11-NEXT: entry: // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -1873,10 +1852,3 @@ int main() { // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4 // CHECK11-NEXT: ret void // -// -// CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK11-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK11-NEXT: entry: -// CHECK11-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK11-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_parallel_for_codegen.cpp b/clang/test/OpenMP/distribute_parallel_for_codegen.cpp index 7bdc4c5ab21a7..95adefa8020f6 100644 --- a/clang/test/OpenMP/distribute_parallel_for_codegen.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_codegen.cpp @@ -2538,13 +2538,6 @@ int main() { // CHECK1-NEXT: ret void // // -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// -// // CHECK3-LABEL: define {{[^@]+}}@main // CHECK3-SAME: () #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: @@ -4265,13 +4258,6 @@ int main() { // CHECK3-NEXT: ret void // // -// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK3-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK3-NEXT: entry: -// CHECK3-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK3-NEXT: ret void -// -// // CHECK9-LABEL: define {{[^@]+}}@main // CHECK9-SAME: () #[[ATTR0:[0-9]+]] { // CHECK9-NEXT: entry: @@ -8886,13 +8872,6 @@ int main() { // CHECK9-NEXT: ret void // // -// CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK9-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK9-NEXT: entry: -// CHECK9-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK9-NEXT: ret void -// -// // CHECK11-LABEL: define {{[^@]+}}@main // CHECK11-SAME: () #[[ATTR0:[0-9]+]] { // CHECK11-NEXT: entry: @@ -13404,10 +13383,3 @@ int main() { // CHECK11: omp.precond.end: // CHECK11-NEXT: ret void // -// -// CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK11-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK11-NEXT: entry: -// CHECK11-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK11-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp b/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp index 9f900facc6a54..46c115e40e435 100644 --- a/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp @@ -504,13 +504,6 @@ int main() { // CHECK1-NEXT: ret void // // -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// -// // CHECK3-LABEL: define {{[^@]+}}@main // CHECK3-SAME: () #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: @@ -759,13 +752,6 @@ int main() { // CHECK3-NEXT: ret void // // -// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK3-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK3-NEXT: entry: -// CHECK3-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK3-NEXT: ret void -// -// // CHECK8-LABEL: define {{[^@]+}}@main // CHECK8-SAME: () #[[ATTR0:[0-9]+]] { // CHECK8-NEXT: entry: @@ -1207,7 +1193,7 @@ int main() { // // // CHECK8-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK8-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK8-SAME: () #[[ATTR1]] comdat { // CHECK8-NEXT: entry: // CHECK8-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK8-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -1685,13 +1671,6 @@ int main() { // CHECK8-NEXT: ret void // // -// CHECK8-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK8-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK8-NEXT: entry: -// CHECK8-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK8-NEXT: ret void -// -// // CHECK10-LABEL: define {{[^@]+}}@main // CHECK10-SAME: () #[[ATTR0:[0-9]+]] { // CHECK10-NEXT: entry: @@ -2127,7 +2106,7 @@ int main() { // // // CHECK10-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK10-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK10-SAME: () #[[ATTR1]] comdat { // CHECK10-NEXT: entry: // CHECK10-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK10-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -2598,10 +2577,3 @@ int main() { // CHECK10-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4 // CHECK10-NEXT: ret void // -// -// CHECK10-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK10-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK10-NEXT: entry: -// CHECK10-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK10-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp b/clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp index 83c9f504ccaca..846e7beb5d92f 100644 --- a/clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp @@ -1609,10 +1609,3 @@ int main() { // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]]) // CHECK1-NEXT: ret void // -// -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR5:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp b/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp index 8c44a1e71ae79..aa981f606cc87 100644 --- a/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp @@ -462,13 +462,6 @@ int main() { // CHECK1-NEXT: ret void // // -// CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK1-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK1-NEXT: entry: -// CHECK1-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK1-NEXT: ret void -// -// // CHECK3-LABEL: define {{[^@]+}}@main // CHECK3-SAME: () #[[ATTR0:[0-9]+]] { // CHECK3-NEXT: entry: @@ -734,13 +727,6 @@ int main() { // CHECK3-NEXT: ret void // // -// CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK3-SAME: () #[[ATTR4:[0-9]+]] { -// CHECK3-NEXT: entry: -// CHECK3-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK3-NEXT: ret void -// -// // CHECK9-LABEL: define {{[^@]+}}@main // CHECK9-SAME: () #[[ATTR0:[0-9]+]] { // CHECK9-NEXT: entry: @@ -1219,7 +1205,7 @@ int main() { // // // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK9-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK9-SAME: () #[[ATTR1]] comdat { // CHECK9-NEXT: entry: // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK9-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -1733,13 +1719,6 @@ int main() { // CHECK9-NEXT: ret void // // -// CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK9-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK9-NEXT: entry: -// CHECK9-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK9-NEXT: ret void -// -// // CHECK11-LABEL: define {{[^@]+}}@main // CHECK11-SAME: () #[[ATTR0:[0-9]+]] { // CHECK11-NEXT: entry: @@ -2212,7 +2191,7 @@ int main() { // // // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiET_v -// CHECK11-SAME: () #[[ATTR5:[0-9]+]] comdat { +// CHECK11-SAME: () #[[ATTR1]] comdat { // CHECK11-NEXT: entry: // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4 // CHECK11-NEXT: [[TEST:%.*]] = alloca [[STRUCT_S_0:%.*]], align 4 @@ -2719,10 +2698,3 @@ int main() { // CHECK11-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4 // CHECK11-NEXT: ret void // -// -// CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg -// CHECK11-SAME: () #[[ATTR6:[0-9]+]] { -// CHECK11-NEXT: entry: -// CHECK11-NEXT: call void @__tgt_register_requires(i64 1) -// CHECK11-NEXT: ret void -// diff --git a/clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp b/clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp index 9f769ca2886fe..5d9244268d554 100644 --- a/clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp +++ b/clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp @@ -112,7 +112,7 @@ int main() { // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4 // CHECK1-NEXT: call void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[S]], i64 noundef 0) // CHECK1-NEXT: [[CALL:%.*]] = invoke noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[S]]) -// CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]] +// CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]] // CHECK1: invoke.cont: // CHECK1-NEXT: store i8 [[CALL]], ptr [[A]], align 1 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0 @@ -145,16 +145,16 @@ int main() { // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]] // CHECK1: omp_offload.failed: -// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68() #[[ATTR4:[0-9]+]] +// CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l68() #[[ATTR3:[0-9]+]] // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]] // CHECK1: lpad: // CHECK1-NEXT: [[TMP15:%.*]] = landingpad { ptr, i32 } -// CHECK1-NEXT: cleanup +// CHECK1-NEXT: cleanup // CHECK1-NEXT: [[TMP16:%.*]] = extractvalue { ptr, i32 } [[TMP15]], 0 // CHECK1-NEXT: store ptr [[TMP16]], ptr [[EXN_SLOT]], align 8 // CHECK1-NEXT: [[TMP17:%.*]] = extractvalue { ptr, i32 } [[TMP15]], 1 // CHECK1-NEXT: store... [truncated] `````````` </details> https://github.com/llvm/llvm-project/pull/80460 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits