This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] AST optimizer in C++?
On Sun, 25 Aug 2002, Pop Sébastian wrote:
> A good idea I saw in the LLVM is that the SSA infromation is
> stored directly in the operations stream: ie. (from
> LLVMCompilationStrategy.pdf) <result> = phi <type> [<val0>,
> <label0>], ..., [<valN>, <labelN>]
> Diego, maybe it is worth to include PHI nodes directly as a
> SIMPLE extension?
I am not too keen on SSA re-writing schemes. When you encode SSA
into your IR, you have the added aggravation of having to
re-write the code twice. Once to convert it into SSA form and
the second time to convert it out of SSA form.
The approach we use now does not interfere with the underlying
IR. What it does is overlay a web of def-use/use-def pointers on
top of the CFG. Each of these def/use/phi references are
associated with a specific operand, expression, statement and
basic block. This means that building the SSA form is not too
expensive (no IR re-writing) and once you're done, you just toss
the data away.
In any case, I'm always ready to be convinced about the benefits
of other approaches. We're in the early stages, and are just now
starting to use the infrastructure to write optimizers. As we
gain experience with it we'll be able to compare different
> This could solve the problem with the tree_common.aux field...
Hmm, what problem? The SSA form does not use that field
(directly). The field is used to annotate trees with various
tidbits of information like what block they belong to, what
variable references are made by it, etc.