[clang] [llvm] [clang][OpenMP][SPIR-V] Fix addrspace of globals and global constants (PR #134399)

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 7 12:27:13 PDT 2025


================
@@ -5384,6 +5384,11 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) {
     LangAS AS;
     if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS))
       return AS;
+    if (LangOpts.OpenMPIsTargetDevice && getTriple().isSPIRV())
----------------
sarnex wrote:

Sure, let me try that. Probably `AS1` will be fine for my use case.

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


More information about the cfe-commits mailing list