[Mlir-commits] [clang] [lld] [llvm] [mlir] [IR] Introduce `T<address space>` to `DataLayout` to represent flat address space if a target supports it (PR #108786)

Matt Arsenault llvmlistbot at llvm.org
Wed Sep 25 10:03:10 PDT 2024


arsenm wrote:

> There are targets that use a different integer to denote flat (e.g. see SPIR & SPIR-V). Whilst I know that there are objections to that, the fact remains that they had historical reason (wanted to make legacy OCL convention that the default is private work, and given that IR defaults to 0 this was an easy, if possibly costly, way out; 

The SPIRV IR would be better off changing its numbers around like we did in AMDGPU ages ago. The only concern would be bitcode compatibility, but given it's still an "experimental target" that shouldn't be an issue.

> AMDGPU also borks this for legacy OCL reasons, which has been a source of pain). 

This is only a broken in-clang hack, the backend IR always uses the correct address space 

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


More information about the Mlir-commits mailing list