[PATCH] D96806: [SampleFDO] Stop repeated indirect call promotion for the same target

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 15:15:00 PST 2021


hoy added a comment.

In D96806#2566458 <https://reviews.llvm.org/D96806#2566458>, @wmi wrote:

> Currently to prevent recursive indirect call promotion, SampleLoaderPass use a DenseSet PromotedInsns to memorize which indirect call has been promoted inside of current function. However, PromotedInsns is cleared everytime emitAnnotation has done for a function, so it cannot prevent the same indirect call being promoted for the same target again in another iteration of emitAnnotation.
>
> On the other side, because of PromotedInsns, an indirect call is limited to be promoted only for one target in every iteration of emitAnnotation. That limits inline instance profile annotation related with indirect call targets. I think PromotedInsns can be deleted after this patch. I will address it in a followup patch after performance testing.

Did you see the recursive indirect call promotion between functions that do not follow top-down order, like functions in an SCC?

I remember this change https://reviews.llvm.org/D38763 prevents re-promotion done by subsequent PGO ICP. Could the existing heuristic in `inlineHotFunctions` be tweaked like PGO ICP? BTW, multiple indirect call targets can be promoted by `inlineHotFunctionsWithPriority`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96806/new/

https://reviews.llvm.org/D96806



More information about the llvm-commits mailing list