[clang] [CIR][HIP] Match kernel handle linkage, visibility and comdat (PR #227267)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 30 05:11:22 PDT 2026


================
@@ -357,6 +357,18 @@ void CIRGenNVCUDARuntime::emitDeviceStub(CIRGenFunction &cgf, cir::FuncOp fn,
     globalOp->removeAttr("sym_visibility");
     globalOp->setAttr("alignment", builder.getI64IntegerAttr(
                                        cgm.getPointerAlign().getQuantity()));
+
+    // The handle must track the kernel stub's linkage/visibility, not the
+    // global-op default (external).
+    globalOp.setLinkage(fn.getLinkage());
----------------
Fznamznon wrote:

Should that happen in `getKernelHandle` where the handle is created?

https://github.com/llvm/llvm-project/pull/227267


More information about the cfe-commits mailing list