[clang] [CIR][HIP] Match kernel handle linkage, visibility and comdat (PR #227267)
Arseniy Obolenskiy via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 14 01:53:32 PDT 2026
================
@@ -417,6 +424,13 @@ mlir::Operation *CIRGenNVCUDARuntime::getKernelHandle(cir::FuncOp fn,
globalOp->setAttr("alignment", builder.getI64IntegerAttr(
cgm.getPointerAlign().getQuantity()));
+ // Inherit visibility and comdat from the kernel's declaration.
+ auto *fd = cast<FunctionDecl>(gd.getDecl());
+ cgm.setGVProperties(globalOp, fd);
+ FunctionTemplateDecl *ft = fd->getPrimaryTemplate();
+ if (!ft || ft->isThisDeclarationADefinition())
+ cgm.maybeSetTrivialComdat(*fd, globalOp);
----------------
aobolensk wrote:
Ok, thanks
https://github.com/llvm/llvm-project/pull/227267
More information about the cfe-commits
mailing list