================
@@ -1452,13 +1472,39 @@ void CIRGenModule::emitGlobalVarDefinition(const 
clang::VarDecl *vd,
                     
cir::CUDAExternallyInitializedAttr::get(&getMLIRContext()));
       }
     } else {
-      // TODO(cir):
       // Adjust linkage of shadow variables in host compilation
-      // getCUDARuntime().internalizeDeviceSideVar(vd, linkage);
+      getCUDARuntime().internalizeDeviceSideVar(vd, linkage);
+    }
+    getCUDARuntime().handleVarRegistration(vd, gv);
+  }
+
+  // Decorate CUDA shadow variables with the cu.shadow_name attribute so we 
know
----------------
RiverDave wrote:

This overwrites the registration attribute you generated above (via 
`getCUDARuntime().handleVarRegistration(vd, gv)`). The attr generation should 
stay centralized in the CUDA runtime hook to match OG 
`CGNVCUDARuntime::handleVarRegistration`. Also, this duplicate path inverts the 
`extern` flag (`vd->hasDefinition()` vs OG’s `!D->hasDefinition()`).


https://github.com/llvm/llvm-project/pull/190087
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to