[tree-ssa]: out-of-ssa breaks if something adds a pred

Chris Lattner sabre@nondot.org
Fri Jun 6 20:45:00 GMT 2003


> > 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/



More information about the Gcc mailing list