[clang] [clang][CodeGen] Add query for a target's flat address space (PR #95728)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 2 07:38:51 PDT 2024
yxsamliu wrote:
> I still think we should not need this. DefaultIsPrivate is junk that needs to be deleted. Querying for LangAS::Default should always give the answer 0 for AMDGPU, which is what this is working around.
>
> This clang notion of address space has nothing to do with your troubles with llvm.used in the IR or SPIRV
LangAS::Default is not just determined by target. It also depends on language. For OpenCL 1.2 it is private. For example, the argument of `void foo(int*)` by language spec points to private addr space, and it translates to addr space 5 instead of 0 in IR. (https://godbolt.org/z/E71E3Wb5e). Due to this, it is hard to let LangAS::Default maps to 0 for amdgpu target for all languages.
https://github.com/llvm/llvm-project/pull/95728
More information about the cfe-commits
mailing list