================ @@ -5384,6 +5384,11 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) { LangAS AS; if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS)) return AS; + if (LangOpts.OpenMPIsTargetDevice && getTriple().isSPIRV()) + // SPIR-V globals should map to CrossWorkGroup instead of default + // AS, as generic/no address space is invalid. This is similar + // to what is done for HIPSPV. + return LangAS::opencl_global; } return getTargetCodeGenInfo().getGlobalVarAddressSpace(*this, D); ---------------- jhuber6 wrote:
Wouldn't this logic fit in here? https://github.com/llvm/llvm-project/pull/134399 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits