Re: SSA without phi

Tommy Thorn <tommy.thorn@gmail.com>
4 May 2007 13:18:00 -0400

          From comp.compilers

Related articles
SSA without phi Nicolas.Capens@gmail.com (2007-04-20)
Re: SSA without phi tommy.thorn@gmail.com (Tommy Thorn) (2007-04-23)
Re: SSA without phi jle@forest.owlnet.rice.edu (2007-04-23)
SSA without phi inderaj@gmail.com (Inderaj Bains) (2007-04-23)
Re: SSA without phi cfc@shell01.TheWorld.com (Chris F Clark) (2007-04-23)
Re: SSA without phi find@my.address.elsewhere (Matthias Blume) (2007-04-26)
Re: SSA without phi Nicolas.Capens@gmail.com (2007-04-29)
Re: SSA without phi tommy.thorn@gmail.com (Tommy Thorn) (2007-05-04)
Re: SSA without phi jle@forest.owlnet.rice.edu (2007-05-04)
Re: SSA without phi inderaj@gmail.com (Inderaj Bains) (2007-05-07)
Re: SSA without phi tommy.thorn@gmail.com (Tommy Thorn) (2007-05-08)
Re: SSA without phi Nicolas.Capens@gmail.com (2007-05-22)
| List of all articles for this month |
From: Tommy Thorn <tommy.thorn@gmail.com>
Newsgroups: comp.compilers
Date: 4 May 2007 13:18:00 -0400
Organization: Compilers Central
References: 07-04-07507-04-152
Keywords: analysis, SSA
Posted-Date: 04 May 2007 13:18:00 EDT

On Apr 29, 4:00 pm, Nicolas.Cap...@gmail.com wrote:


> I just find it a bit unnatural to work with and I wondered whether
> there are any simpler representations (with equivalent
> advantages). Apparently that doesn't exist though...


Again, that's debatable. IMO, graph based representation tends to be
much easier to work with and a lot of stuff comes nearly for free. I'd
strongly recommend reading Paul Havlak's Thesis "Interprocedural
Symbolic Analysis" and also Marc-Michael Brandis' "Thesis on 'Small
and Fast Optimizing Compilers'". There's always more to say on that
subject, but it's a good start:
- http://www.hgsc.bcm.tmc.edu/~havlak/thesis/
- http://compilers.iecc.com/comparch/article/95-02-164
- http://compilers.iecc.com/comparch/article/95-03-077


> Anyway, maybe I'm just not using the simplest approach and I need to
> get more familiar with SSA. I rename every variable by giving them a
> completely new name (actually just a number), and keeping their old
> name in a table. But a lot of tutorials on SSA give the variables an
> index, and after optimization just drop the index and remove phi-
> functions. Does that make the implementation more elegant?


AFAICT, that is likely to be incorrect in the face of any non-trivial
optimizations. Leaving SSA requires a real register allocation either
way.


With a graph based representation you don't get too attached to names;
they are just pointers to nodes. If a full graph IR is too scary, you
can always just use them inter-basic block. I guarantee that it will
simplify your code.


Tommy


Post a followup to this message

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