4 ms·
> they don’t use that to control optimization levels applied to various code. GCC does. I think LLVM does to some extent too.
by glandium 3y ago
> they don’t use that to control optimization levels applied to various code.
GCC does. I think LLVM does to some extent too.
- vlovich123 3y agoWhere can I read up on this? AFAIK PGO is used in lieu of various heuristics within a pass, but is not used to remove optimization passes on “dead code”.
- KMag 3y agoDead code is a very specific term, meaning unreachable code paths that can be safely eliminated. You mean cold code paths, not dead code.
- glandium 3y agoGood question, I unfortunately don't have a link to give you, or fine details, but GCC does hot/cold partitioning and applies different optimization level to hot and cold code blocks. IIRC, it uses the level given on the command line for hot code, and -Os for cold code.
- vlovich123 3y agoI see nothing in the documentation to suggest that. The only thing I’m aware compilers do for hot/cold is partitioning to improve locality.