Skip to content

Commit 363258a

Browse files
authored
[Offload] Remove old references to isCtor (#91766)
Summary: These have long since been removed, support for ctors / dtors now happens through special kernels the backend creates.
1 parent c34d189 commit 363258a

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

offload/plugins-nextgen/common/include/PluginInterface.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,6 @@ struct GenericKernelTy {
270270
/// Get the kernel name.
271271
const char *getName() const { return Name; }
272272

273-
/// Return true if this kernel is a constructor or destructor.
274-
bool isCtorOrDtor() const {
275-
// TODO: This is not a great solution and should be revisited.
276-
return StringRef(Name).ends_with("tor");
277-
}
278-
279273
/// Get the kernel image.
280274
DeviceImageTy &getImage() const {
281275
assert(ImagePtr && "Kernel is not initialized!");

offload/plugins-nextgen/common/src/PluginInterface.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ GenericKernelTy::getKernelLaunchEnvironment(
470470
// Ctor/Dtor have no arguments, replaying uses the original kernel launch
471471
// environment. Older versions of the compiler do not generate a kernel
472472
// launch environment.
473-
if (isCtorOrDtor() || RecordReplay.isReplaying() ||
473+
if (RecordReplay.isReplaying() ||
474474
Version < OMP_KERNEL_ARG_MIN_VERSION_WITH_DYN_PTR)
475475
return nullptr;
476476

@@ -579,9 +579,6 @@ void *GenericKernelTy::prepareArgs(
579579
uint32_t &NumArgs, llvm::SmallVectorImpl<void *> &Args,
580580
llvm::SmallVectorImpl<void *> &Ptrs,
581581
KernelLaunchEnvironmentTy *KernelLaunchEnvironment) const {
582-
if (isCtorOrDtor())
583-
return nullptr;
584-
585582
uint32_t KLEOffset = !!KernelLaunchEnvironment;
586583
NumArgs += KLEOffset;
587584

0 commit comments

Comments
 (0)