================ @@ -71,14 +71,19 @@ class GlobalDecl { GlobalDecl(const FunctionDecl *D, unsigned MVIndex = 0) : MultiVersionIndex(MVIndex) { if (!D->hasAttr<CUDAGlobalAttr>()) { + if (D->hasAttr<OpenCLKernelAttr>()) { + Value.setPointerAndInt(D, unsigned(KernelReferenceKind::Kernel)); + return; + } ---------------- rjmccall wrote:
It looks like there's new commonality between OpenCL and CUDA kernels, and this feels like a generalizable feature. Please add a method to `FunctionDecl` (and, looking at the rest of the patch, also `FunctionTemplateDecl`?) named something like `isReferenceableKernel()` that checks for either of these two attributes. Most of the diffs in this patch should end up just changing various bits of existing code that check specifically for `CUDAGlobalAttr` to call that method instead. For this change specifically, you'll want to make sure that `getDefaultKernelReference` does the right thing for OpenCL kernels. https://github.com/llvm/llvm-project/pull/115821 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits