[all-commits] [llvm/llvm-project] a45d72: [CSSPGO] Add switch for sample loader to honor glo...

WenleiHe via All-commits all-commits at lists.llvm.org
Wed Aug 25 17:25:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a45d72e0247d080eb9437736bb6cadfc27e4c065
      https://github.com/llvm/llvm-project/commit/a45d72e0247d080eb9437736bb6cadfc27e4c065
  Author: Wenlei He <aktoon at gmail.com>
  Date:   2021-08-25 (Wed, 25 Aug 2021)

  Changed paths:
    M llvm/lib/ProfileData/SampleProfReader.cpp
    M llvm/lib/Transforms/IPO/SampleProfile.cpp
    A llvm/test/Transforms/SampleProfile/Inputs/csspgo-use-preinliner.prof
    A llvm/test/Transforms/SampleProfile/csspgo-use-preinliner.ll
    M llvm/tools/llvm-profgen/ProfileGenerator.cpp

  Log Message:
  -----------
  [CSSPGO] Add switch for sample loader to honor global pre-inliner decision from llvm-profgen

The change adds a switch to allow sample loader to use global pre-inliner's decision instead. The pre-inliner in llvm-profgen makes inline decision globally based on whole program profile and function byte size as cost proxy.

Since pre-inliner also adjusts/merges context profile based on its inline decision, honoring its inline decision in sample loader would lead to better post-inline profile quality especially for thinlto where cross module profile merging isn't possible without pre-inliner.

Minor fix in profile reader is also included. When pre-inliner is use, we now also turn off the default merging and trimming logic unless it's explicitly asked.

Differential Revision: https://reviews.llvm.org/D108677




More information about the All-commits mailing list