This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] Mark inlinings stopped with inlining history as noinline
ClosedPublic

Authored by aeubanks on May 19 2023, 12:40 PM.

Details

Summary

The inline history makes sure that we don't keep inlining due to mutual devirtualization. But this gets forgotten between inliner invocations.

So mark the inlined calls as noinline so we respect previous inline history decisions.

This overlaps with D121084, but they're not redundant since we may not inline completely through a child SCC, but we still want a cost multiplier when that happens.

See discussions in D145516.

Diff Detail

Event Timeline

aeubanks created this revision.May 19 2023, 12:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 12:40 PM
aeubanks requested review of this revision.May 19 2023, 12:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 12:40 PM
nikic added a comment.May 19 2023, 1:06 PM

This makes sense to me, but I have to admit that I'm getting somewhat lost in all the different ways we have of mitigating exponential inlining (InlineHistory, InlinedInternalEdges, InlineCostMultiplier, ...)

aeubanks updated this revision to Diff 523912.May 19 2023, 1:17 PM

add comment

jmorse accepted this revision.May 25 2023, 3:40 AM

This speeds up compile time for the reproducer we have by one or two orders of magnitude, definitely feels like the right direction to take, LGTM.

How do you feel about this being in a LLVM-16 point release, exponential behaviour is a reasonably serious defect to be avoided IMO.

This revision is now accepted and ready to land.May 25 2023, 3:40 AM