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]

Re: redirect_edge_and_branch questions


Hello,

> > So what happens is that I redirect a bunch of edges to the new forwarder
> > block, and any edges which aren't redirected get their PENDING_STMT list
> > cleared.  I might be able to work around this, but it is a tad annoying.
> > 
> > When do we tell the cfg routines that we are not in SSA mode any more?
> > Do they differentiate between SSA and trees at all?  
> 
> How serious would it break things if I taught ssa_redirect_edge that if
> there are no PHI nodes, leave the edge list alone. or are their other
> dependancies on that somewhere?

this IMHO should work, but it is really not nice.

> that seems a bit hacky tho.

The clean way obviously would be not to use PENDING_STMT list for the
purpose of remembering arguments of phi nodes on redirected edges.
Which would mean adding a new field to edge to contain the phi node (and
have extra memory overhead).  Or old contents of PENDING_STMT could be
preserved (held as a first member of the list, or something like that)
and put back by the routines that arrange for the phi arguments to be
put on their final location.  Or redirect_edge could have some entirely
different way of passing the arguments it removed to the caller
(although I just now do not see a good way how to do it).  Or we could
request the phi arguments to be removed by the caller before calling
redirect_edge.

The last possibility seems best to me, although it would require
changing all places where we handle phi node arguments in PENDING_STMT
list.

Zdenek


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