[clang] [AMDGPU] Add builtin to test for constant memory (PR #209679)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 19:40:35 PDT 2026


yxsamliu wrote:

@Artem-B Re: whether constant memory matters on AMD:

Yes, constant address space still matters on AMD. LLVM already uses it in AA, Attributor memory effects, vectorization cost, and load lowering.

A compile-time-only answer works for direct cases like `&c`, but not for pointers passed through functions, stored, loaded back, or selected at runtime. For CUDA-compatible semantics, the builtin needs to answer those dynamic pointer cases too.

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


More information about the cfe-commits mailing list