This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] Do not mix callsite and callee hotness based updates.
ClosedPublic

Authored by eraman on May 12 2017, 5:20 PM.

Details

Summary

Update threshold based on callee's hotness only when BFI is not available. Otherwise use only callsite's hotness. This makes it easier to reason about hotness related threshold updates.

Diff Detail

Event Timeline

eraman created this revision.May 12 2017, 5:20 PM
chandlerc accepted this revision.May 12 2017, 10:54 PM

It would be good in the patch description to maybe clarify the intent / motivation here? I assume the goal is to simplify reasoning about which thresholds are triggered in which cases when the new PM is available? At least, that is my guess based on our in-person conversations.

Anyways, feel free to submit, just seems good to provide context to others reading.

test/Transforms/Inline/inline-hot-callsite.ll
2

; without ; without -> ; without

This revision is now accepted and ready to land.May 12 2017, 10:54 PM

Turns out that this change is incorrect. When sample profile is used, we use callsite hotness even without BFI. In a separate patch, I plan to add a method in ProfileSummaryInfo to determine if the module has sample profile. Then I can fix this patch by using callsite hotness either when sample profile is used or when BFI is available.

chandlerc requested changes to this revision.May 16 2017, 11:02 AM

(Just marking this as no longer ready to go so it shows back up in my queue...)

Turns out that this change is incorrect. When sample profile is used, we use callsite hotness even without BFI. In a separate patch, I plan to add a method in ProfileSummaryInfo to determine if the module has sample profile. Then I can fix this patch by using callsite hotness either when sample profile is used or when BFI is available.

Good catch!!!

This revision now requires changes to proceed.May 16 2017, 11:02 AM
eraman updated this revision to Diff 99196.May 16 2017, 2:14 PM
eraman edited edge metadata.
eraman edited the summary of this revision. (Show Details)

Use callsite's hotness for sample PGO.

chandlerc accepted this revision.May 16 2017, 2:16 PM

LGTM again! =D

This revision is now accepted and ready to land.May 16 2017, 2:16 PM
This revision was automatically updated to reflect the committed changes.