[llvm] [Offload] Remove old references to `isCtor` (PR #91766)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Fri May 10 09:47:57 PDT 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/91766
Summary:
These have long since been removed, support for ctors / dtors now
happens through special kernels the backend creates.
>From 8f17858111a00903af7bf75adaadbda2392d5e98 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Fri, 10 May 2024 11:45:06 -0500
Subject: [PATCH] [Offload] Remove old references to `isCtor`
Summary:
These have long since been removed, support for ctors / dtors now
happens through special kernels the backend creates.
---
offload/plugins-nextgen/common/include/PluginInterface.h | 6 ------
offload/plugins-nextgen/common/src/PluginInterface.cpp | 5 +----
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/offload/plugins-nextgen/common/include/PluginInterface.h b/offload/plugins-nextgen/common/include/PluginInterface.h
index e7a008f3a8573..c396099ac6252 100644
--- a/offload/plugins-nextgen/common/include/PluginInterface.h
+++ b/offload/plugins-nextgen/common/include/PluginInterface.h
@@ -270,12 +270,6 @@ struct GenericKernelTy {
/// Get the kernel name.
const char *getName() const { return Name; }
- /// Return true if this kernel is a constructor or destructor.
- bool isCtorOrDtor() const {
- // TODO: This is not a great solution and should be revisited.
- return StringRef(Name).ends_with("tor");
- }
-
/// Get the kernel image.
DeviceImageTy &getImage() const {
assert(ImagePtr && "Kernel is not initialized!");
diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp
index fae197527850a..a5c8cce63facf 100644
--- a/offload/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp
@@ -470,7 +470,7 @@ GenericKernelTy::getKernelLaunchEnvironment(
// Ctor/Dtor have no arguments, replaying uses the original kernel launch
// environment. Older versions of the compiler do not generate a kernel
// launch environment.
- if (isCtorOrDtor() || RecordReplay.isReplaying() ||
+ if (RecordReplay.isReplaying() ||
Version < OMP_KERNEL_ARG_MIN_VERSION_WITH_DYN_PTR)
return nullptr;
@@ -579,9 +579,6 @@ void *GenericKernelTy::prepareArgs(
uint32_t &NumArgs, llvm::SmallVectorImpl<void *> &Args,
llvm::SmallVectorImpl<void *> &Ptrs,
KernelLaunchEnvironmentTy *KernelLaunchEnvironment) const {
- if (isCtorOrDtor())
- return nullptr;
-
uint32_t KLEOffset = !!KernelLaunchEnvironment;
NumArgs += KLEOffset;
More information about the llvm-commits
mailing list