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: Chris Lattner <sabre at nondot dot org>
- To: Andrew MacLeod <amacleod at redhat dot com>
- 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: Fri, 6 Jun 2003 15:49:30 -0500 (CDT)
- Subject: Re: [tree-ssa]: out-of-ssa breaks if something adds a pred
> > 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 ... on an edge, why should the insert routine
> have to update a PHI node?
The inserter code does not have to update the PHI, because of the inserted
code, at all: the variables do not interact with the PHI nodes in the edge
destination block at all until they are explicitly linked in by the caller
of the insertion stuff.
The reason that the edge inserter may need to update PHI nodes is if it
splits a critical edge. Say we are inserting code on the critical edge
A->B. In this case, B may contain PHI nodes with entries from the basic
block A. ALL of these entries need to be updated to say that the incoming
value actually comes from the newly inserted block, not directly from A
anymore. This keeps the invariant that the PHI nodes always have one
entry from each predecessor.
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/