[llvm] [RFC][ThinLTO] Reduce the number of function name promotions (PR #178587)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 4 23:06:51 PST 2026
================
@@ -309,7 +313,9 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
if (GV.hasLocalLinkage() && shouldPromoteLocalToGlobal(&GV, VI)) {
// Save the original name string before we rename GV below.
auto Name = GV.getName().str();
- GV.setName(getPromotedName(&GV));
+ if (AlwaysPromoteImportedLocalFunctions || VI.renameOnPromotion())
----------------
teresajohnson wrote:
Rather than looking at all copies of the summary, just look at the one in this module. We get this inside shouldPromoteLocalToGlobal (look at the call to findSummaryInModule in that function). Probably to avoid doing that call multiple times we can refactor that call out of shouldPromoteLocalToGlobal and pass the result in instead of the VI. Then check the flag in that summary here.
https://github.com/llvm/llvm-project/pull/178587
More information about the llvm-commits
mailing list