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

Shilei Tian via All-commits all-commits at lists.llvm.org
Thu Oct 10 12:55:39 PDT 2024


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

  Changed paths:
    M llvm/include/llvm/Analysis/InlineAdvisor.h
    M llvm/include/llvm/Analysis/InlineCost.h
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/lib/Analysis/InlineAdvisor.cpp
    M llvm/lib/Analysis/InlineCost.cpp
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h
    A llvm/test/Transforms/Inline/AMDGPU/amdgpu-inline-only-one-live-use.ll

  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