This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
redirect_edge_and_branch questions
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Jan Hubicka <jh at suse dot cz>, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Fri, 01 Oct 2004 11:41:12 -0400
- Subject: redirect_edge_and_branch questions
I have a couple of questions about redirecting edges in SSA.
AS a part of SSA->normal, we sometimes insert stmts on incoming edges to
blocks with PHI nodes. I can now detect when the same stmts are being
issued on multiple edges, and issue the stmts once. These stmts are
issued either into a new block, or an existing one if there are no stmts
in it (other than a label). The remaining edges are then redirected to
that block.
So there appears to be two issues.
First, This proceeds to invalidate the dominators. Right now, I simply
delete the existing dominators since SA->normal doesn't care about them
anyway. Does anything *after* SSA->normal use dominators, requiring
them to be recalculated?
And aside from that, why doesn't redirect_edge_and_branch() do whatever
dominator updates are required. It has exactly the same information I
have if I wanted to update them.
Second, after performing these edge redirections, I get the following
kinds of warnings:
<L10>:;
D.1121 = 0;
goto <bb 4> (<L6>);
Invalid sum of incoming frequencies 8519, should be 3008
<L4>:;
D.1121 = 1;
Invalid sum of incoming frequencies 4489, should be 10000
<L6>:;
return D.1121;
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...
Andrew