2 ms·
It's not just validation. A lot of things compilers have to do becomes dramatically simpler with structured control flow and simpler means faster. When you op
by FullyFunctional 7y ago
It's not just validation. A lot of things compilers have to do becomes dramatically simpler with structured control flow and simpler means faster. When you operate on an unstructured CFG you first have to analyze the entire graph to find the dominators, loops etc and then you have to propagate the dataflow information in that order. All these complications go away.
There's been a few other works that realized this, among them the CORTL IR, suggested by Carl McConnell in his Thesis proposal "Tree Based Optimizations" and the IR used in the Oberon compiler by Michael Franz.
- jnordwick 7y ago1. You can have both. Jumps (conditional or unconditional allow for more complex control flow and different control flow than was immediately thought of. 2 only having structured control flow makes it a difficult target for HLL, which is what was is supposed to be. 3. A few years ago I was working on an array language and was trying to use tree based optimization and code generation, but I put it on hold until i understood more - can you recommend and links or papers? 4. Wasm is an IR, both target and source. Why not add a goto and structured primitive. There are clearly some things that cannot be compiled anywhere remotely performant.