================ @@ -5384,6 +5384,11 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) { LangAS AS; if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS)) return AS; + if (LangOpts.OpenMPIsTargetDevice && getTriple().isSPIRV()) ---------------- AlexVlx wrote:
This seems ok. I would suggest that we consider, in the override, returning `opencl_constant` (2) only for OCL, and otherwise returning the global var AS (1), to prevent crashing into the invalid cast problem. 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