This is the mail archive of the gcc-patches@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: PR middle-end 42906 (empty loops not removed when leaved via critical edge with PHI node attached)


> Hi Honza,
> 
> On Sat, 27 Mar 2010, Jan Hubicka wrote:
> 
> > +	  /* For PHI operands it matters from where the control flow arrives
> > +	     to the BB.  Consider the following example:
> > +
> > +	     a=exp1;
> > +	     b=exp2;
> > +	     if (test)
> > +		;
> > +	     else
> > +		;
> > +	     c=PHI(a,b)
> > +
> > +	     Doing so is too restrictive in the case the predecestor block is in
> 
> s/predecestor/predecessor/ multiple times,
Uh, thanks.
> 
> > +	     This scenario can be avoided by splitting critical edges.
> 
> In your scenario there are no critical edges, as the empty blocks 
> (predecessors of the c=PHI block) have only one successor.  Given that the 
> whole example is confusing.  It would probably be good to rework it :)

Well, the testcase is supposed to demonstrate that control dependency of PHI
argument must be marked to avoid wrong code problems.

The problem with critical edges causing empty loops to not be removed is next
problem. I.e. marking the control dependnecy of source BB (needed to fix the
testcase shown) causes too much of control flow to me barked live.  The
testcase with empty loop leaved via critical edge that is redundant is
different (and the one in PR is smallest one I can think of).  I can add it to
the comment if it seems to help.  It will make long comment even longer ;))

Honza
> 
> 
> Ciao,
> Michael.


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