1. Sep 30, 2022
    • Kazu Hirata's avatar
      [ModuleInliner] Add a cost-benefit-based priority · 4e9dd210
      Kazu Hirata authored
      This patch teaches the module inliner a traversal order designed for
      the instrumentation FDO (+ThinLTO) scenario.
      
      The new traversal order prioritizes call sites in the following order:
      
      1. Those call sites that are expected to reduce the caller size
      
      2. Those call sites that have gone through the cost-benefit analaysis
      
      3. The remaining call sites
      
      With this fairly simple traversal order, a large internel benchmark
      yields performance comparable to the bottom-up inliner -- both in
      terms of the execution performance and .text* sizes.
      
      Big thanks goes to Liqiang Tao for the module inliner infrastructure.
      
      I still have hacks outside this patch to prevent excessively long
      compilation or .text* size explosion.  I'm trying to come up with
      acceptable solutions in near future.
      
      Differential Revision: https://reviews.llvm.org/D134376
      4e9dd210
  2. Sep 29, 2022