[llvm-branch-commits] [clang] [CIR][CUDA] Handle CUDA module constructor and destructor emission. (PR #188673)

David Rivera via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Mar 29 11:17:30 PDT 2026


================
@@ -1792,8 +1797,122 @@ void LoweringPreparePass::buildCUDAModuleCtor() {
   gpuBinHandle.setInitialValueAttr(builder.getConstNullPtrAttr(voidPtrPtrTy));
   gpuBinHandle.setPrivate();
 
-  // TODO: ctor/dtor/register_globals
-  assert(!cir::MissingFeatures::globalRegistration());
+  // Declare this function:
+  //    void **__{cuda|hip}RegisterFatBinary(void *);
+
+  std::string regFuncName =
----------------
RiverDave wrote:

Note that the comment above applies to the other related call sites in this PR too.

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


More information about the llvm-branch-commits mailing list