Conversation

Is there a document somewhere that describes what optimizations PGO opens up? Like I imagine it can say "don't inline this, it doesn't get called" and "inline this, it gets called a bunch", but what else?
1
2
Replying to
It provides branch metadata so it knows how to order branches or add hints for better branch prediction. Can also decide when to use cmov, etc. that way. Since it has metadata on function call sites, callees and branches it can also split out functions into hit/cold regions, etc.
2
Replying to and
Inlining and the limited partial inlining are of course heavily influenced by it but it does a lot more than that. If you marked a lot of your functions cold / hot and added branch metadata to every if statement with __builtin_expect_with_probability you could get most manually.
1