3 ms·
I could see this being used in things like PGO compilers. Identifying a rare subpath (or more usefully: all the rare subpaths) in a particular control-flow all
by kannanvijayan 7y ago
I could see this being used in things like PGO compilers.
Identifying a rare subpath (or more usefully: all the rare subpaths) in a particular control-flow allows a lot of down-stream leverage.
Opportunities exist for biasing everything from register allocation to code-motion towards optimizing the fast-path branch. Additionally, if the rarely-taken branch is part of a conditional that introduces new definitions that are phi-ed later on, the joining block (and subsequent blocks) can be split (specialized) for the fast-path and slow-path cases.
This would open up opportunities for constant-optimization - constants introduced in the common-path branch which stop being constants later on due to phis can remain constants in the modified control flow.
And you get the usual round of benefits for DCE, GVN, etc. coming out of that too.