[PATCH] D27602: [PGO] Fix insane counts due to nonreturn calls

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 04:00:15 PST 2016


xur added a comment.

Using the test case as the example: exit() is called in bar0. The instrumentation is in bb2 (which calls bar0), bb4 and bb5.
bb2 is 21. bb4 is 0 and bb5 is 20. To make the edge flow balanced, we have to make edge 1-->3 as -1.

The real issue is that we don't have an edge from bar0 to the fake exit. We don't know if bar0 has a noreturn call. 
The real solution is to split the BB with calls and and a fake edge.

We know this limitation when implementing IR PGO and we chose to tolerate this.


https://reviews.llvm.org/D27602





More information about the llvm-commits mailing list