[PATCH] D137184: [PGO] Add a threshold for number of critical edges in PGO

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 16:29:28 PDT 2022


wenlei added a comment.

In D137184#3900182 <https://reviews.llvm.org/D137184#3900182>, @xur wrote:

> In D137184#3900121 <https://reviews.llvm.org/D137184#3900121>, @wenlei wrote:
>
>> Why is number of critical edges (as opposed to IR size or number of blocks) a better indicator for function size related build speed issues?
>
> If we don't split the critical edge, the CFGs are the same for w/ and w/o PGO (for after PGO pass). So if the CFG is too big for some passes, PGO won't make it worse.
>
> When we split the CFG, the CFGs for w/ and w/o PGO are different. The extra BBs added is roughly proportional to number of critical edges. So more critical edges means more discrepancy.
> That's the main reason I choose to use number of critical edges as the threshold.

Makes sense if the goal is to avoid/limit extra build time incurred from PGO. Thanks for clarification.


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

https://reviews.llvm.org/D137184



More information about the llvm-commits mailing list