5 ms·
The "default" profile "for PGO" is the compiler on its own -- folk put a lot of effort into making sure it will generally compile arbitrary code well. And a bi
by andrewaylett 4y ago
The "default" profile "for PGO" is the compiler on its own -- folk put a lot of effort into making sure it will generally compile arbitrary code well. And a big part of that is lots of people running lots of open source code and measuring how well it performs.
The difficulty with "as much open source code as they can find" is that we need to execute the code to make a profile. And unless we're running the code under real-world conditions, there's no guarantee that we'll generate a useful profile. So we need to be a little careful about which code we look at from a performance perspective. Even when we have a profile, it's a count of branches taken for the specific code that was compiled, and it's not normally applicable to either a different version of the compiler or any input that's not identical to the input used for profiling. With link-time optimisations, even a "common" profile for library code isn't necessarily going to be useful: which bits of a library we'll try to inline will vary according to the code that's calling it.
- johntb86 4y agoTo that point, llvm now has an "ml inliner" that's been trained on a lot of open source code to allow it to make the best inlining decisions.