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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 08:00:51 PST 2026


================
@@ -3500,10 +3505,12 @@ static LValue EmitGlobalVarDeclLValue(CodeGenFunction &CGF,
     return EmitThreadPrivateVarDeclLValue(CGF, VD, T, Addr, RealVarTy,
                                           E->getExprLoc());
   }
-  LValue LV = VD->getType()->isReferenceType() ?
-      CGF.EmitLoadOfReferenceLValue(Addr, VD->getType(),
-                                    AlignmentSource::Decl) :
-      CGF.MakeAddrLValue(Addr, T, AlignmentSource::Decl);
+  const bool IsReference = VD->getType()->isReferenceType();
----------------
erichkeane wrote:

Yeah, seems to me we should have a more 'automatic' way of propagating this.

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


More information about the cfe-commits mailing list