cmd/compile/internal/inline: hairyVisitor doesn't properly account for conditionally-inlined PGO calls #59484
Labels
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
In
hairVisitor.doNode
we give calls a cost of 57, unless the call is inlineable, in which case we use the cost of the callee, under the assumption that this call will get inlined."Inlineable" here more-or-less just means that
fn.Inl != nil
. In a non-PGO build, we only setfn.Inl
if the function cost is < 80, making it inlineable ~anywhere.In a PGO build,
fn.Inl
is set for any function involved in a hot callsite (e.g.,a
->b
), but we will only inline at the hot callsite. Any other callsite (e.g.,c
->b
) will not inline. This makes the assumption incorrect and means that the cold caller (c
) will have an artificially inflated cost, potentially making it too expensive to inline.I will send a CL to fix this.
cc @cherrymui @thanm @mdempsky
The text was updated successfully, but these errors were encountered: