README.pgo.md
1# Using Profile Guided Optimizations to identify compiler optimization failures
2
3When using Clang, the `-Rpass-missed` flag enables the verbose log of failed
4compiler optimizations. However, the extensive log messages can obscure
5potential optimization opportunities.
6
7Use the following steps to generate a more transparent optimization report
8using a previously created PGO profile file. The report also includes code
9hotness diagnostics:
10
11```bash
12$ ../libvpx/configure --use-profile=perf.profdata \
13 --extra-cflags="-fsave-optimization-record -fdiagnostics-show-hotness"
14```
15
16Convert the generated YAML files into a detailed HTML report using the
17[optviewer2](https://github.com/OfekShilon/optview2) tool:
18
19```bash
20$ opt-viewer.py --output-dir=out/ --source-dir=libvpx .
21```
22
23The HTML report displays each code line's relative hotness, cross-referenced
24with the failed compiler optimizations.
25