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: GCC 3.3


> I don't understand your new patch:
> 
> ! 	  /* Do not delete instructions initializing operands needed by dead
> ! 	     instruction with side effects.  */
> ! 	  || (!counts[REGNO (x)] && incr > 0
> ! 	      && insn_live_p (insn, NULL)))
>  
> First, INSN is live -- not dead, given that insn_live_p holds.

It is not live, just it is undeletable because it has side effects or
something else.  insn_live_p checks that.
> 
> Second, no deletion is taking place here.

Yes, but we have to increase the counter in order to avoid other
deletions to happen (all values used by this insn must appear live.  All
the test does it to bypass values both used and initialized by the insn
so the insn is deleted entirely in the case the values are not elsewhere
like in dead induction variable)
>   
> Third, checking incr > 0 is pointless, since all that happens if the
> condition is true is:
> 
>   counts[REGNO (x)] += incr;

incr is either 1 or -1.
> 
> Fourth, why check !counts[REGNO (x)]?
This is just optimization - we don't have to call that expensive
function when the instruction is live for another reason already.
> 
> I think you want something more like:
> 
>   /* If this instruction is live, then even modifications to the  
> destination register matter. */
>   || insn_live_p (insn, NULL)

No, modifications never matters, just uses.
> 
> But then, the comment above the entire function needs to change, since
> it explicitly says that modifications to the destination register don't
> matter.
> 
> In light of this, please revert your original patch on the 3.3 branch,
> but proceed with fixing it on the mainline.  We can consider this
> optimization for 3.3.1 if it is stable by then.

OK.  My CVS access is deadly slow here in Barcelona, but I will try to
do it tonight.

Honza
> 
> Thanks,
> 
> -- 
> Mark Mitchell
> CodeSourcery, LLC
> mark@codesourcery.com


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