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: Diego Novillo <dnovillo at redhat dot com>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Andrew Macleod <amacleod at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: 06 Jun 2003 16:26:40 -0400
- Subject: Re: [tree-ssa]: out-of-ssa breaks if something adds a pred
- Organization: Red Hat Canada
- References: <60EF7BC4-9858-11D7-9DAE-000A95A34564@dberlin.org>
On Fri, 2003-06-06 at 15:52, Daniel Berlin wrote:
> When something ends up adding a predecessor block to a block with phi's
> in it, out-of-ssa breaks.
> This is because it expects all the phi's to have the same number of
> args/edges as preds, but phi's created *before* the pred was added have
> one less argument/edge.
>
Then whoever created the new edge should have added a
>
> IE into-ssa makes the following:
> BLOCK 13, preds 2, 1
> a_8 = PHI<a_9 (1), a_10 (2)>
>
> Later, an edge insertion causes the following (due to creation of a new
> block):
> BLOCK 13, preds 2, 1, 15
> a_8 = PHI<a_9 (1), a_10 (2)>
>
Wait, why does it matter that a new block is being inserted? When we
create a new block to break critical edges, we should not be altering
the number of incoming edges to the target block.
B1 B2
| \ /
| \E1 /
| \ /
| B13
|
B3
Presumably, you are inserting in edge E1? If so, the new block B15
should not create a *third* incoming block to B13:
B1 B2
| \ /
| \ /
| B15 /
| \ /
| \/
| B13
|
B3
The PHI nodes at B13 should just be rewritten to change all the
arguments that were coming from B1, to come from B15. I think this is
something the edge insertion commit routine can do automatically.
Andrew?
Diego.