Continuing my exploration of reimplementing an optimizing compiler to run on our hypothetical string-centric CPU... We need to extract additional info from the control-flow graph!
The "dominators" of a block are those which necessarily runs before it, simply due to the graph's structure. We can compute by iterating over each block's predecessors & taking the closest common ancestor between them as the block's dominator, until fixpoint. I'd task our "Arithmetic Core" coprocessor with this.
1/2?