[all-commits] [llvm/llvm-project] a554af: [AMDGPU] Increase inline threshold when the callee...

Shilei Tian via All-commits all-commits at lists.llvm.org
Sun Oct 6 13:28:36 PDT 2024


  Branch: refs/heads/users/shiltian/inline-threshold-with-only-one-use
  Home:   https://github.com/llvm/llvm-project
  Commit: a554afb49a96ac881ec023e96eedfa216fd5ca90
      https://github.com/llvm/llvm-project/commit/a554afb49a96ac881ec023e96eedfa216fd5ca90
  Author: Shilei Tian <shilei.tian at amd.com>
  Date:   2024-10-06 (Sun, 06 Oct 2024)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

  Log Message:
  -----------
  [AMDGPU] Increase inline threshold when the callee only has one live use

Currently we will not inline a large function even if it only has one live use.
This could significantly impact the performance because CSR spill is very
expensive. The goal of this PR is trying to force the inlining if there is only
one live use by adjusting the inlining threshold, which is a configurable
number. The default value is 15000, which borrows from
`InlineConstants::LastCallToStaticBonus`. I'm not sure if this is a good number,
and if this is the right way to do that. After making this change, the callee in
my local test case can finally be inlined, but the cost is still very close to
the threshold: `cost=14010, threshold=170775`.

Speaking of the test, how are we gonna test this? Do we want to include a giant
IR file?

Fixes SWDEV-471398.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list