------- Comment #23 from hubicka at gcc dot gnu dot org  2010-03-24 19:02 
-------
Created an attachment (id=20188)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20188&action=view)
Patch in testing

Hi,
this is patch I am testing.

I was also re-thinking the problem of redirecting BB with dead conditional to
next useful postdominator (that is the "fixed" version of algorihm by shiller).
I am not convinced we can pick random PHI argument here as Richard changed my
original code looking for source of control dependent graph.

The testcase would be something like

BB1 with succesors BB2 and BB6
BB2 with succesors BB3 and BB4
BB3 and BB4 with succesors BB5

and BB6 containing PHI that is A from BB1 and B from BB3 or BB4
If we end up eliminating BB3 and BB4 and thus condition in BB3, we will
redirect BB3 to BB5.  The argument of PHI however must be updated to B for new
edge, not A as we pick currently.

I will try to create real world testcase and I think we can fix this by
avoidiging the redirection.  Cytron et al suggest using random edge leaving BB
with dead conditional.  This is wrong since it closes infinite loops.  I think
we can instead of that just pick random edge that is not loopback edge in DFS.
That won't close loops and will result in acyclic reverse EBBS of empty blocks
we easilly cleanup afterwards.

Honza


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42906

Reply via email to