foreach ... else statement

Walter Bright newshound1 at digitalmars.com
Tue Jan 6 23:15:25 PST 2009


Andrei Alexandrescu wrote:
> The challenge the paper addresses is constructing the SSA form in one 
> shot. There are indeed algorithms that build the SSA in several passes.
> 
> My vague recollection from a compiler construction class is that there 
> are a number of static analyses that need to do a fixed-point 
> computation on loops. Such analyses can deal with any jumps except a 
> particular one: jump forward from the outside of a loop in the middle of 
> it. Does anyone know what analyses were those?

The two-entry-points-to-a-loop is the essential characteristic of an 
"irreducible flow graph". Such can be transformed into reducible ones, 
but it is not worth the effort because such are fairly rare, even in 
spaghetti goto code.

<nose-in-air>I've known for 25 years that it's freaking easy to do 
optimizations if you can assume there are no goto's. But you wind up 
with a crippled compiler technology suitable only for toy languages. 
That's why real compilers aren't written that way.</nose-in-air>

I only read part of the paper, but I don't see the point of it.



More information about the Digitalmars-d mailing list