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: [patch] reload1.c: Very minor speedup.


On Fri, Feb 06, 2004 at 11:34:43PM +0100, Paolo Carlini wrote:
> Hi,
> 
> >Attached is a patch to micro-optimize the reset of can_eliminate in
> >reload1.c.
> 
> >- if (ep->from_rtx == x && ep->can_eliminate)
> >+ if (ep->from_rtx == x)
> >ep->can_eliminate = 0;
> 
> if you have got two spare minutes, could you possibly explain a bit?
> 
> I mean, it's because the cost of a test (&& ep->can_eliminate) is
> comparable to that of an assignment (ep->can_eliminate = 0), never
> much smaller? Is it true on every architecture?

In fact it was just discussed that sometimes this is not a win,
depending on your target.

It seems to me that this sort of source micro-optimization is not a
good thing.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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