[llvm] [SamplePGO] Support -salvage-stale-profile without probes too (PR #86116)

Krzysztof Pszeniczny via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 05:01:53 PDT 2024


amharc wrote:

> FWIW, there is a TODO of LTO time matching for AutoFDO path, see: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/IPO/SampleProfile.cpp#L2239, it doesn't extract the non-callsite line-location anchor, so the regular instruction still uses the old mapping which may lead to inaccurate block count.

Yes, I'm aware of this TODO and I plan to work on it afterwards. Properly matching just callsite line-locations helps a lot on itself too: it affects the inlining behaviour of the sample profile loader. If `Foo` calls `Bar` calls `Baz`, adding new lines in `Foo` above the will no longer cause the whole profile for `Baz` inlined into `Bar` inlined into `Foo` to be dropped with this change (and with `-mllvm=-salvage-stale-profile=true`). Real life functions tend to be short, so the performance loss from non-call lines in `Foo` having wrong profile weights shouldn't matter as much as the performance loss from the total lack of past inlining information (and profiles contextualised to the inlined instances).

https://github.com/llvm/llvm-project/pull/86116


More information about the llvm-commits mailing list