3 ms·
The compiler I work with most, Graal, does the opposite and keeps structured loops as a first-class concept in the graph almost all the way through compilation,
by chrisseaton 5y ago
The compiler I work with most, Graal, does the opposite and keeps structured loops as a first-class concept in the graph almost all the way through compilation, and turns jumps into a structured loop if it can. We find it makes reasoning about the loops easier. It does make irreducible control-flow harder to deal with (and in some cases impossible.)
- WalterBright 5y agoC doesn't constrain what e1, e2, and e3 are or what they do in `for(e1;e2;e3)`, and goto's can be willy-nilly turning it into a hash anyway. Hence, trying to use the higher level construct is going to result in lots of special case code, and special case code is much more likely to lead to problems. But hey, if Graal works for you, great!