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

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 1 13:57:55 PDT 2022


xur added a comment.

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.


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

https://reviews.llvm.org/D137184



More information about the llvm-commits mailing list