Re: Intermediate Representation (Pierre Jouvelot)
Mon, 13 Aug 90 21:41:19 GMT

          From comp.compilers

Related articles
[10 earlier articles]
Re: Intermediate Representation grover@brahmand.Eng.Sun.COM (1990-08-12)
Re: Intermediate Representation (1990-08-12)
Re: Intermediate Representation (1990-08-12)
Re: Intermediate Representation convex!csmith@uunet.UU.NET (1990-08-12)
Re: Intermediate Representation (1990-08-13)
Re: Intermediate Representation (1990-08-13)
Re: Intermediate Representation (1990-08-13)
Re: Intermediate Representation (1990-08-13)
Re: Intermediate Representation (Eric Muller) (1990-08-14)
Re: Intermediate Representation pd@complex.Eng.Sun.COM (1990-08-15)
Re: Intermediate Representation (1990-08-18)
Re: Intermediate Representation (1990-08-20)
intermediate representation (1991-02-20)
[5 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Pierre Jouvelot)
Keywords: code, optimize, design
Organization: MIT
References: <> <> <> <>
Date: Mon, 13 Aug 90 21:41:19 GMT

In article <>
(Preston Briggs) writes:

>In article <> 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) :

        instruction = block:instruction* + test + call + loop + unstructured ;

        test = condition:expression x true:instruction x false:instruction ;

        unstructured = instruction x predecessors:unstructured*
x successors:unstructured* ;


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.

. CAI, Ecole des Mines, Paris (France):
. LCS, MIT, Cambridge (USA):

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.