[tree-ssa] Insert on edge comment

Andrew MacLeod amacleod@redhat.com
Mon Jun 2 22:09:00 GMT 2003


On Mon, 2003-06-02 at 17:44, Daniel Berlin wrote:
> 
> 
> On Mon, 2 Jun 2003, Chris Lattner wrote:
> 
> > On Mon, 2 Jun 2003, [iso-8859-1] Pop Sébastian wrote:
> >
> > > This is the facet of "instruction stream controlled by the CFG", rather
> > > than the classic view of "trees over which we keep up to date the CFG".
> > >
> > > If I'm not wrong this is still one of the major advantages of the
> > > representation that LLVM has over the current status of tree-ssa.  Chris?
> >
> > Yup, this is how we do it in LLVM.  It was worked out quite well for us,
> > and makes things like successors/predecessors of a basic block extremely
> > easy to find... making just about every CFG based analysis and
> > optimization simpler.  I highly recommend things like loop expressions, if
> > expressions and switch statements be lowered down into the equivilent
> > "conditional branch", "unconditional branch", and "multi-way branch"
> > instructions...
> 
> This would solve the whole fun with "insert after while statement at end
> of block" stuff i deal with.
> It's only because of the special semantics of the "while" statement that
> this occurs in the first place.
> If it was just a simple jump, we'd insert before. But it's a whole magic
> expression with a body and whatnot.


I read this as saying you are trying to find ways of inserting on an
edge without using the insert_on_edge routines.

We do have an on demand insert_on_edge routine. Its currently static and
only called by the edge_commit routine, but we could wrap it up.  Its
clever enough to not create new basic blocks if it doesn't have to. Your
exmaples of the PHI node at the top of loops... I beleive you can quite
safely insert on all those edges and never get another basic block. We
could add a flag to it telling it to return TRUE or FALSE based on
whether a new block would be created and not perform the insertion if it
has to split blocks, if that helps.

Tell me what you are trying to do that you are having problems with...
Thats the infrastructure we are trying to provide right now... If you
present us with cases where we really can't handle it easily, then we
consider changing the way we do it. No one wants to use something which
is awkward.... so we want to fix it.

Andrew



More information about the Gcc mailing list