[clang] [clang][CodeGen] Add AS for Globals to SPIR & SPIRV datalayouts (PR #88455)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 12 13:47:42 PDT 2024


AlexVlx wrote:

> The change seems reasonable.
> 
> > CodeGen/LLVM will default to AS0 in this case, which produces Globals that end up in the private address space for e.g. OCL, HIPSPV or SYCL.
> 
> Can we add a test checking LLVM address space for globals emitted from OCL/HIPSPV/SYCL, please? It's surprising that we need to modify only a datalayout string check.

I can add another one here, but there's a bunch of them coming in #88182, which roundabout motivated this change. I'll emphasise that this is only a problem for things such as implicitly generated globals (e.g. VTables or typeinfo for classes etc.), so it's just a subset of all globals that are impacted (there are already some tests covering direct usage AFAICS).

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


More information about the cfe-commits mailing list