aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/Target
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-02-21 11:33:32 -0600
committerGitHub <noreply@github.com>2024-02-21 11:33:32 -0600
commitcc374d8056990a4c6df44173ad7ef59474ba498b (patch)
treed24104558975f9980f63b59ba6fd8114f26a9de4 /mlir/test/Target
parent58f45d909d2a1565128846e423b480808736f214 (diff)
downloadllvm-cc374d8056990a4c6df44173ad7ef59474ba498b.zip
llvm-cc374d8056990a4c6df44173ad7ef59474ba498b.tar.gz
llvm-cc374d8056990a4c6df44173ad7ef59474ba498b.tar.bz2
[OpenMP] Remove `register_requires` global constructor (#80460)
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.
Diffstat (limited to 'mlir/test/Target')
-rw-r--r--mlir/test/Target/LLVMIR/openmp-llvm.mlir6
1 files changed, 0 insertions, 6 deletions
diff --git a/mlir/test/Target/LLVMIR/openmp-llvm.mlir b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
index 036367b..39a1e03 100644
--- a/mlir/test/Target/LLVMIR/openmp-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
@@ -2744,10 +2744,4 @@ llvm.func @omp_task_if(%boolexpr: i1) {
// -----
-// Check that OpenMP requires flags are registered by a global constructor.
-// CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }]
-// CHECK-SAME: [{ i32, ptr, ptr } { i32 0, ptr @[[REG_FN:.*]], ptr null }]
-// CHECK: define {{.*}} @[[REG_FN]]({{.*}})
-// CHECK-NOT: }
-// CHECK: call void @__tgt_register_requires(i64 10)
module attributes {omp.requires = #omp<clause_requires reverse_offload|unified_shared_memory>} {}