[PATCH] fix ix86 prefetch support with -Os

Janis Johnson janis187@us.ibm.com
Mon Jan 21 16:01:00 GMT 2002


On Mon, Jan 21, 2002 at 02:59:49PM -0800, Richard Henderson wrote:
> On Mon, Jan 21, 2002 at 02:17:31PM -0800, Janis Johnson wrote:
> > But what if the user wants smaller code in general but still wants a
> > prefetch optimization?  The prefetch parameters vary from machine to
> > machine within ix86, and if they come from the size_cost info then
> > they are wrong for some machines.
> 
> Yes, but I still don't see anything wrong with setting the parameters
> such that prefetching isn't used.  It's a bone-headed combination of
> parameters.

OK, I agree that it is bone-headed, but not as dumb as using -Os with
-funroll-all-loops, and GCC allows that.

I'm not sure that using the wrong parameters will prevent the
optimization from happening; it might just generate really dumb prefetch
instructions.  The prefetch parameters are currently used only for
-fprefetch-loop-arrays, but later there will be additional prefetch
optimizations, and we shouldn't rely on them being skipped just because
the prefetch parameters aren't valid.

I'm also uncomfortable with disabling a requested optimization without
any kind of a warning, particularly since GCC doesn't do that for other
optimizations specified along with -Os.

Janis



More information about the Gcc-patches mailing list