>In article <1990Aug11.203048.848@mintaka.lcs.mit.edu> I write:>>>With the AST approach, the cleanest way to deal with this overabundance of>>control structures is to define a single "generic" loop construct; all the>>control structures can then be trivially desugared (e.g., by the parser)>>into your own version of loop.>>I don't see the trivial desuguring by the parser, particularly with an IF ->GOTO form of the loop.>>I can see discovering the entire CFG and then doing interval analysis to>discover a nice tree-like grouping of nested control structures a la Sharir>(or others), but you're still punting on irreducible flow graphs.

Well, you almost got a point here. The way the PIPS system deals with
irreducible flow graphs is interesting. Basically, the AST data type
definition looks something like this (I use the straightforward NewGen
syntax) :

which says that an instruction is either a block (which is a list of
instructions), a test (which has a condition expression and a true and false
instruction), a call or a loop (not specified here) or an "unstructured". An
"unstructured" datatype denotes a control structure that could correspond to
an irreducible graph. The key point is that the instruction that appears in
an "unstructured" value can be *any* instruction (i.e., can be a block, or a
test ... or even another control graph !). The usual data flow algorithms
seem to carry along with this kind of recursive approach (although I still
have to find the time to prove it :-).

With this way, you keep the power of ASTs while being able to deal with
arbitrary control graphs on which, our parallelizer is pretty unable to do
much about, anyway. However, notice that, if you can figure out (as I do)
that a "dirty" control graph is embedded inside an otherwise "nice" DO loop,
then from the outside, the loop looks like a well structured one which can
be parallelized ; this is a great plus of this approach.