[all-commits] [llvm/llvm-project] cae033: Inlining: Run the legacy AlwaysInliner before the ...

Amara Emerson via All-commits all-commits at lists.llvm.org
Thu Feb 9 16:49:42 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cae033dcf227aeecf58fca5af6fc7fde1fd2fb4f
      https://github.com/llvm/llvm-project/commit/cae033dcf227aeecf58fca5af6fc7fde1fd2fb4f
  Author: Amara Emerson <amara at apple.com>
  Date:   2023-02-09 (Thu, 09 Feb 2023)

  Changed paths:
    M clang/test/CodeGen/code-coverage.c
    M clang/test/Frontend/optimization-remark-with-hotness-new-pm.c
    M clang/test/Headers/__clang_hip_math.hip
    M clang/test/OpenMP/bug57757.cpp
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    M llvm/test/Other/new-pm-defaults.ll
    M llvm/test/Other/new-pm-print-pipeline.ll
    M llvm/test/Other/new-pm-thinlto-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
    M llvm/test/Other/new-pm-thinlto-prelink-samplepgo-defaults.ll
    A llvm/test/Transforms/Inline/always-inline-newpm.ll
    M llvm/test/Transforms/PhaseOrdering/ARM/arm_mult_q15.ll

  Log Message:
  -----------
  Inlining: Run the legacy AlwaysInliner before the regular inliner.

We have several situations where it's beneficial for code size to ensure that every
call to always-inline functions are inlined before normal inlining decisions are
made. While the normal inliner runs in a "MandatoryOnly" mode to try to do this,
it only does it on a per-SCC basis, rather than the whole module. Ensuring that
all mandatory inlinings are done before any heuristic based decisions are made
just makes sense.

Despite being referred to the "legacy" AlwaysInliner pass, it's already necessary
for -O0 because the CGSCC inliner is too expensive in compile time to run at -O0.

This also fixes an exponential compile time blow up in
https://github.com/llvm/llvm-project/issues/59126

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




More information about the All-commits mailing list