================
@@ -6446,22 +6446,7 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const
VarDecl *D) {
}
LangAS CodeGenModule::GetGlobalConstantAddressSpace() const {
- // OpenCL v1.2 s6.5.3: a string literal is in the constant address space.
- if (LangOpts.OpenCL)
- return LangAS::opencl_constant;
- if (LangOpts.SYCLIsDevice)
- return LangAS::sycl_global;
- if (LangOpts.HIP && LangOpts.CUDAIsDevice && getTriple().isSPIRV())
- // For HIPSPV map literals to cuda_device (maps to CrossWorkGroup in
SPIR-V)
- // instead of default AS (maps to Generic in SPIR-V). Otherwise, we end up
- // with OpVariable instructions with Generic storage class which is not
- // allowed (SPIR-V V1.6 s3.42.8). Also, mapping literals to SPIR-V
- // 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 (auto AS = getTarget().getConstantAddressSpace())
- return *AS;
- return LangAS::Default;
+ return CodeGenUtils::getGlobalConstantAddressSpace(LangOpts, getTarget());
----------------
Fznamznon wrote:
Should OGCG use `CodeGenUtils` function directly instead of a wrapper?
https://github.com/llvm/llvm-project/pull/226996
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits