[llvm] Change how branch weight is annotated for direct call (PR #90315)

David Li via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 08:39:13 PDT 2024


david-xl wrote:

> > Say the binary being profiled has an indirect call and the sample profile has an indirect target profile for the site. In thinLTO prelink compilation, the indirect call is indirect call promoted resulting with if-then-else in which 'then' branch has a direct call. In the postlink compilation, when the sample profile is loaded, it is better to use the call count to annotate the block.
> 
> When doing ICP, we should distribute counts to the generated if-then-else as part of profile maintenance. Specifically, the generated block for the direct call should get the correct call counts as part of ICP for that target. In that case, post-link won't try to overwrite existing counts anyways.

Ack. @huangjd can you describe in more details how the inconsistency gets triggered?

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


More information about the llvm-commits mailing list