[clang] [clang] Allow overriding any global variable address space (PR #195612)

Sameer Sahasrabuddhe via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 5 23:15:29 PDT 2026


ssahasra wrote:

> After digging into it a bit more, I think I understand what you mean. If I define a `hip_barrier` type, I can set it as the AS of the named barrier type in the ASTContext directly, and it should "just work", or at least work much more smoothly. I'll look into it more and try to get a patch up, thanks

The name `LangAS::hip_barrier` makes me a teeny weeny bit uncomfortable, because the need for yet another address space is new, and there may be some pivot later. Would it make sense to make a generic name that suggests "this is a non-memory resource named using a pointer" that isn't necessarily limited to just named barriers? And then lower it specifically to `addrspace(13)` in LLVM IR by examining the type?

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


More information about the cfe-commits mailing list