[PATCH] D27687: [ThinLTO] Thin link efficiency improvement: don't re-export globals (NFC)

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 11:27:04 PST 2016


tejohnson added a comment.

In https://reviews.llvm.org/D27687#624065, @mehdi_amini wrote:

> 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).
>
>
> Good catch!
>
> > 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*.


Figured out why - see https://reviews.llvm.org/D27755 (which is complementary to this patch)


https://reviews.llvm.org/D27687





More information about the llvm-commits mailing list