redirect_edge_and_branch questions

Andrew MacLeod
Mon Oct 4 14:50:00 GMT 2004

On Fri, 2004-10-01 at 15:32, Jan Hubicka wrote:
> edirect_edge_and_branch() do whatever
> > dominator updates are required. It has exactly the same information I
> > have if I wanted to update them.
> No, it doesn't.
> It is dificult to effectivly update dominator tree when you know just
> that you are redirecting edge from block A to B, while it is trivial
> when you know, for instance, that you are splitting block into two.
> So updating dominators relies on higher level knowledge of what is going
> on.
> > 

Well, all I know is that I am redirecting some arbitrary incoming edges
to some other block which is a predecessor to this block. I don't know
where they came form or how they relate to each other.  Before I have to
figure this all out, does anyone use dominators after SSA->normal? I
don't want to update them if I don't have to.

> > So my next question is why doesn't redirect_edge_and_branch() also
> > update the block frequencies?   Again, it has the same information I
> > have...
> It does not again.  For instance if you are moving edge to skip
> forwarder block, it is trivial to walk the path and update, but for
> instance when you are doing jump threading, it is already nontrivial
> issue, so again you have to know why you are redirecting the edge and
> how.


Given an edge, don't you know either the percentage taken or edge count
for that edge?  So if its being redirected, you deduct that edges count
from the original destination block, redirect it, and add it in at the
new destination's block. 

OR am I missing something about our implementation?


More information about the Gcc mailing list