[llvm-dev] Questions about Profile Guided Optimization (PGO)

Reixiong Hu via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 27 09:46:59 PDT 2021

Hello, All,


I am studying the optimizations adopted by LLVM, and finding PGO, which is said to be a good helper for optimization.

Since that requires to instrument and execute the object program, which may be costly for compilation and sometimes inconvenient for developers to come up with test cases, I wonder whether it is a default option for the compilation (i.e., when -O2 or -O3 is enabled)?

If that is the case, how LLVM generates test cases for the profiling if no tests are provided?

If PGO is default and there are no test cases, does LLVM estimate the profiling information, such as frequencies of bbs or calls, statically?


Thanks for your time.



Reixiong Hu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210628/8cc6814f/attachment.html>

More information about the llvm-dev mailing list