This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa]: out-of-ssa breaks if something adds a pred
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Chris Lattner <sabre at nondot dot org>
- Cc: Daniel Berlin <dberlin at dberlin dot org>,gcc mailing list <gcc at gcc dot gnu dot org>,Diego Novillo <dnovillo at redhat dot com>
- Date: 06 Jun 2003 16:38:05 -0400
- Subject: Re: [tree-ssa]: out-of-ssa breaks if something adds a pred
- References: <Pine.LNX.4.44.0306061529570.18201-100000@nondot.org>
On Fri, 2003-06-06 at 16:30, Chris Lattner wrote:
> > > OTOH, the inserter cannot possibly know how to update the PHI nodes,
> > > only
> > > the caller can. If the caller doesn't know how to update the PHI
> > > nodes,
> > > something is seriously wrong.
> >
> > The inserter created the new bb and edges, it thus should know how to
> > update the phi nodes.
>
> Oh, yes, well insertion-on-edges should automatically update the PHI
> nodes, because it _already has_ all of the information it needs... :)
>
The current insert on edge routines, like the other inserts, do nothing
with PHIs.
If I insert
a_5 = b_6 * 2
on an edge, why should the insert routine have to update a PHI node?
Maybe one of the PHI nodes is
a_6 = PHI <a_2(3), a_3(4)>
How does the edge inserted know what the effect on this PHI node is?
Its the person inserting the code that knows what the effect, if any,
is.
Oh, you mean xhanging the incoming edge if we split?. If we have the
above PHI, and we insert the same stmt on the edge from block 3, and we
create BB 8, then the PHI node needs to be updated to read:
a_6 = PHI <a_2(8), a_3(4)>
Then the person inserting the code can go and make whatever change is
required (if any) for the definition of a_5...
This I intend to do, but havent yet since insert_on_edge was only being
used by out-of-ssa, so I didint care about that. It isnt hard...
Andrew