Hey all,

From my CS theory, a control flow graph models a program flow and one of its main characteristics is it has one entry and exit point. IIRC, CPython’s compilation process involves generation of a control flow graph.

Contrary to peephole optimizations, optimizations on the  control flow graph are more global allowing us to have complex and global optimizations like branch and checkpoint eliminations etc.


I have seen several implementations of control flow optimizations. The one I am familiar with is the V8 control flow optimizer.


I tried to investigate this for one of my directed courses last fall but I want to know if there are people who have been thinking about this for CPython and what their thoughts are.

--
Best,
Joannah Nanjekye
"You think you know when you learn, are more sure when you can write, even more when you can teach, but certain when you can program."
Alan J. Perlis