Introduce a new attribute "function-inline-cost-multiplier" which multiplies the inline cost of a call site (or all calls to a callee) by the multiplier. When processing the list of calls created by inlining, check each call to see if the new call's callee is in the same SCC as the original callee. If so, set the "function-inline-cost-multiplier" attribute of the new call site to double the original call site's attribute value. This does not happen when the original call site is intra-SCC. This is an alternative to D120584, which marks the call sites as noinline. Hopefully fixes PR45253. Reviewed By: davidxl Differential Revision: https://reviews.llvm.org/D121084
20 lines
377 B
LLVM
20 lines
377 B
LLVM
; RUN: opt -S -passes='inline' < %s | FileCheck %s
|
|
|
|
; Make sure we don't mark calls within the same SCC as original function with noinline.
|
|
; CHECK-NOT: function-inline-cost-multiplier
|
|
|
|
define void @samescc1() {
|
|
call void @samescc2()
|
|
ret void
|
|
}
|
|
|
|
define void @samescc2() {
|
|
call void @samescc3()
|
|
ret void
|
|
}
|
|
|
|
define void @samescc3() {
|
|
call void @samescc1()
|
|
ret void
|
|
}
|