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

Alexey Bader via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 12 14:15:12 PDT 2024


https://github.com/bader commented:

> I'll emphasise that this is only a problem for things such as implicitly generated globals (e.g. VTables or typeinfo for classes etc.)

I suppose usage of VTables and typeinfo is kind of restricted in GPU programming models. Right?

Anyway, I think it's a reasonable change for SPIR target, which fixes mapping from `global` address space to `1` LLVM address space.
It's less obvious for SPIR-V, which is not LLVM-based format and mapping between SPIR-V and LLVM addresses spaces is technically an implementation detail, which can be adjusted.
According to my understanding, today LLVM IR for SPIR-V target just follows SPIR target nomenclature.

I'd like Eli/John to give formal approval for this change, but I'm okay with it. 👍 Thanks!

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


More information about the cfe-commits mailing list