[tree-ssa]: out-of-ssa breaks if something adds a pred
Diego Novillo
dnovillo@redhat.com
Fri Jun 6 20:30:00 GMT 2003
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.
More information about the Gcc
mailing list