This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]