[llvm] [SamplePGO] Add a cutoff for number of profile matching anchors (PR #95542)

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 09:58:59 PDT 2024


david-xl wrote:

> Thanks for the work, acknowledged that I supposed the num of anchors is not super big while working on #87375 . However, we could lost some opportunities if skipping the large function matching , especially since larger functions are more likely to have code changes(no matter if it's edited by human). Trying to think if we can fix it by improve the current one: One is to improve the myers-diff memory cost, which I thinking maybe we can use a more efficient structure instead of 2-D array. Another way is I'm wondering if it makes sense to support both the algorithm(the diff and the old one), then make it configurable, e.g. if the callsite num is big, it automatically switches to a the lightweight one. (`Git` also support different diff algorithm, like `git diff --diff-algorithm=minimal|myers|...`).
> 
> (More for discussion for the best approach than asking to do it in this path)

Sounds good. For the time being, the patch looks ok (to workaround OOM issues experience)?

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


More information about the llvm-commits mailing list