This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] reload1.c: Very minor speedup.
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: Kazu Hirata <kazu at cs dot umass dot edu>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Feb 2004 18:24:31 -0500
- Subject: Re: [patch] reload1.c: Very minor speedup.
- References: <20040206.171033.29958882.kazu@cs.umass.edu> <40241683.9020701@suse.de>
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