[all-commits] [llvm/llvm-project] 4e9dd2: [ModuleInliner] Add a cost-benefit-based priority

kazutakahirata via All-commits all-commits at lists.llvm.org
Thu Sep 29 09:00:55 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e9dd21015f2ed4d57d6bea08ca08a30ef6e5ce8
      https://github.com/llvm/llvm-project/commit/4e9dd21015f2ed4d57d6bea08ca08a30ef6e5ce8
  Author: Kazu Hirata <kazu at google.com>
  Date:   2022-09-29 (Thu, 29 Sep 2022)

  Changed paths:
    M llvm/lib/Analysis/InlineOrder.cpp

  Log Message:
  -----------
  [ModuleInliner] Add a cost-benefit-based priority

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




More information about the All-commits mailing list