Files
clang-p2996/llvm/test/Transforms/Inline/AMDGPU/amdgpu-inline-only-one-live-use.ll
Shilei Tian e34e27f198 [TTI][AMDGPU] Allow targets to adjust LastCallToStaticBonus via getInliningLastCallToStaticBonus (#111311)
Currently we will not be able to inline a large function even if it only
has one live use because the inline cost is still very high after
applying `LastCallToStaticBonus`, which is a constant. This could
significantly impact the performance because CSR spill is very
expensive.

This PR adds a new function `getInliningLastCallToStaticBonus` to TTI to
allow targets to customize this value.

Fixes SWDEV-471398.
2024-10-11 10:19:54 -04:00

23 lines
637 B
LLVM

; RUN: opt -mtriple=amdgcn-amd-amdhsa -S -passes=inline -inline-threshold=0 -debug-only=inline-cost %s -o - 2>&1 | FileCheck %s
; REQUIRES: asserts
; CHECK: Analyzing call of callee_not_only_one_live_use... (caller:caller)
; CHECK: Cost: -30
; CHECK: Analyzing call of callee_only_one_live_use... (caller:caller)
; CHECK: Cost: -165030
define internal void @callee_not_only_one_live_use() {
ret void
}
define internal void @callee_only_one_live_use() {
ret void
}
define void @caller() {
call void @callee_not_only_one_live_use()
call void @callee_not_only_one_live_use()
call void @callee_only_one_live_use()
ret void
}