[PATCH] D27687: [ThinLTO] Thin link efficiency improvement: don't re-export globals (NFC)
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 11:18:36 PST 2016
mehdi_amini added a comment.
In https://reviews.llvm.org/D27687#621385, @tejohnson wrote:
> However, I realized last night when I was building past the thin link stage that this patch is not correct. The reason is that the ExportList includes globals that were added because they were imported somewhere (in which case we have already processed their calls/references here and don't need to do it again), as well as those added to the ExportList by exportGlobalInModule (in which case we have not already processed their calls/refs).
> I looked at this initially because a perf-events profile of the thin link showed that GlobalValueSummary::modulePath() was the hottest routine (it is invoked frequently by exportGloballnModule), and exportGlobalInModule was 7th.
This sounds suspicious to me: `GlobalValueSummary::modulePath()` is a simple accessor. For it to be so hot it means it is calls many times *and we're not doing anything with the returned value*.
More information about the llvm-commits