Adds the following switches:
- --sample-profile-inline-replay-fallback/--cgscc-inline-replay-fallback: controls what the replay advisor does for inline sites that are not present in the replay. Options are:
- Original: defers to original advisor
- AlwaysInline: inline all sites not in replay
- NeverInline: inline no sites not in replay
- --sample-profile-inline-replay-format/--cgscc-inline-replay-format: controls what format should be generated to match against the replay remarks. Options are:
- Line
- LineColumn
- LineDiscriminator
- LineColumnDiscriminator
Adds support for negative inlining decisions. These are denoted by "will not be inlined into" as compared to the positive "inlined into" in the remarks.
All of these together with the previous --sample-profile-inline-replay-scope/--cgscc-inline-replay-scope allow tweaking in how to apply replay. In my testing, I'm using:
- --sample-profile-inline-replay-scope/--cgscc-inline-replay-scope = Function to only replay on a function
- --sample-profile-inline-replay-fallback/--cgscc-inline-replay-fallback = NeverInline since I'm feeding in only positive remarks to the replay system
- --sample-profile-inline-replay-format/--cgscc-inline-replay-format = Line since I'm generating the remarks from DWARF information from GCC which can conflict quite heavily in column number compared to Clang
An alternative configuration could be to do Function, AlwaysInline, Line fallback with negative remarks which closer matches the final call-sites. Note that this can lead to unbounded inlining if a negative remark doesn't match/exist for one reason or another.
Updated various tests to cover the new switches and negative remarks
Testing:
ninja check-all
I think we shold start moving the replay stuff in its header (with possibly some refactoring of how we get to obtain an advisor)