================ @@ -5402,6 +5407,10 @@ LangAS CodeGenModule::GetGlobalConstantAddressSpace() const { // UniformConstant storage class is not viable as pointers to it may not be // casted to Generic pointers which are used to model HIP's "flat" pointers. return LangAS::cuda_device; + if (LangOpts.OpenMPIsTargetDevice && getTriple().isSPIRV()) + // OpenMP SPIR-V global constants should map to UniformConstant, different + // from the HIPSPV case above. + return LangAS::opencl_constant; ---------------- AlexVlx wrote:
I believe that whilst this makes sense you might run into obnoxious issues where valid source ends up generating a SPIR-V invalid cast to/from generic/constant, which will fail in the translator / fail SPIR-V validation (HIP code runs into this). I *think* we need to relax this restriction at least in the translator / BE, or potentially extend SPIR-V itself in this direction. 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