[clang] [Clang][OpenCL] Mark scalar loads from constant address space invariant (PR #218356)

Keshav Vinayak Jha via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 23:57:11 PST 2026


https://github.com/keshavvinayak01 commented:

I’ve removed those ad-hoc additions from ` CGExpr.cpp`.

Invariance is established from the declaration/type when constructing the storage address, then preserved by the shared GEP and address-space-cast helpers and `Address::withElementType()`. 

Propagation now follows address construction rather than being reapplied for individual expression kinds; scalar load emission simply consumes the address’s flag.

@erichkeane thoughts?

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


More information about the cfe-commits mailing list