[clang] [llvm] [CIR][CUDA] Introduce cu.var_registration for shadow and attach device-side var metadata, internalize device side variables, and lower poison attribute (PR #190087)

Konstantinos Parasyris via cfe-commits cfe-commits at lists.llvm.org
Fri May 22 07:44:14 PDT 2026


================
@@ -1049,6 +1069,8 @@ void CIRGenModule::replaceGlobal(cir::GlobalOp oldGV, cir::GlobalOp newGV) {
   // erased) operation, which would leave them detached from the module.
   if (lastGlobalOp == oldGV)
     lastGlobalOp = newGV;
+  if (cudaRuntime)
+    cudaRuntime->handleGlobalReplace(oldGV, newGV);
----------------
koparasy wrote:

I would do here :

```cpp
if (getLangOpts().CUDA) 
      getCUDARuntime().handleGlobalReplace(oldGV, newGV);
```


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


More information about the cfe-commits mailing list