rjmccall added inline comments.
================ Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:172 + if (llvm::Constant *C = dyn_cast<llvm::Constant>(Addr)) + Cast = llvm::ConstantExpr::getBitCast(C, ObjectPtr[0]); + else ---------------- This check is already done by `CreateBitCast`. ================ Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:176 + llvm::Value *Args[2] = {llvm::ConstantInt::getSigned(Int64Ty, Width), Cast}; Builder.CreateCall(InvariantStart, Args); } ---------------- I know this is a pre-existing code pattern, but there's an overload of `CreateCall` that just takes two arguments directly; please switch the code to use that. ================ Comment at: clang/lib/CodeGen/CGExpr.cpp:1255 ApplyDebugLocation DL(*this, E); + LValue Ret; switch (E->getStmtClass()) { ---------------- This is not the way to do this, but fortunately it's unnecessary anyway. You can just put the invariant-load metadata on any loads from the constant address space in the functions called by `EmitLoadOfLValue`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75423/new/ https://reviews.llvm.org/D75423 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits