On Gentoo you can easily enable PGO using portage-bashrc-mv [1]. Install and set PGO=1 for a single package or system wide. That's it.
[1]: https://github.com/vaeth/portage-bashrc-mv
[1]: https://github.com/vaeth/portage-bashrc-mv
for (int i = 0; __builtin_expect_with_probability(i < num_iter, 1, 1023.0/1024.0); ++i) // hints that num_iter is typically 1024 { __builtin_expect_with_probability(condition_A && condition_B, 1, 0.001); __builtin_expect_with_probability(condition_A || condition_B, 1, 0.99); if (condition_A) { /* do stuff */ } if (condition_B) { /* do other stuff */ } }
Comment