[all-commits] [llvm/llvm-project] 7cde4f: [AMDGPU] Increase inline threshold when the callee...
Shilei Tian via All-commits
all-commits at lists.llvm.org
Thu Oct 10 13:03:56 PDT 2024
Branch: refs/heads/users/shiltian/inline-threshold-with-only-one-use
Home: https://github.com/llvm/llvm-project
Commit: 7cde4f21d6a045df253e7c88fc0c6904505a237a
https://github.com/llvm/llvm-project/commit/7cde4f21d6a045df253e7c88fc0c6904505a237a
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