[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:45:47 PST 2016

mehdi_amini added a comment.

In https://reviews.llvm.org/D27687#624080, @tejohnson wrote:

> > 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)

I'm still quite surprised that the accessor `modulePath()` is the limit here:

  auto SummaryIter = llvm::find_if(
      [&](const std::unique_ptr<GlobalValueSummary> &Summary) {
        return Summary->modulePath() == ExportModulePath;

I guess it is inlined and the profiler is likely not separating perfectly the body of modulePath() from the context.


More information about the llvm-commits mailing list