[clang] [CIR][SPIR-V] Move global address space selection to a target hook (PR #231098)

Arseniy Obolenskiy via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 09:05:24 PDT 2026


================
@@ -2330,14 +2330,7 @@ CIRGenModule::getAddrOfConstantStringFromLiteral(const StringLiteral *s,
 
 mlir::ptr::MemorySpaceAttrInterface
 CIRGenModule::getGlobalCIRAddressSpace(LangAS as) {
----------------
aobolensk wrote:

hmm... I'm not sure I get your point. There is CIRGenModule::getGlobalVarAddressSpace and it is untouched and all the handling that is similar to classic code gen you referenced is there:

CIR:

https://github.com/llvm/llvm-project/blob/d15445a80c3f67313c047f7c7d04bf8c75c646e0/clang/lib/CIR/CodeGen/CIRGenModule.cpp#L1037-L1068

vs classic:
https://github.com/llvm/llvm-project/blob/d15445a80c3f67313c047f7c7d04bf8c75c646e0/clang/lib/CodeGen/CodeGenModule.cpp#L6423-L6462

IMO, these functions are aligned here

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


More information about the cfe-commits mailing list