This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fmove-all-movables and -freduce-all-givs
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Mark Stephenson <mstephen at MIT dot EDU>
- Cc: gcc at gcc dot gnu dot org, fortran at gnu dot org
- Date: Mon, 10 May 2004 10:43:30 +0200
- Subject: Re: -fmove-all-movables and -freduce-all-givs
- Organization: Moene Computational Physics, Maartensdijk, NL
- References: <408D7AE1.50000@mit.edu>
Mark Stephenson wrote:
I'm currently researching how machine learning algorithms can be
employed to discover effective compiler heuristics. I see from your
online documentation that -fmove-all-movables and -freduce-all-givs can
sometimes generate slower code.
These optimizations seem like prime candidates for machine learning
because the tradeoffs are not clear (in my mind it seems like the
optimizations should always yield speedups).
Can you please let me know for which applications these optimizations
are detrimental to performance? And do you have any intuition as to why
they are detrimental?
[ Sorry for the late reply - I was behind on e-mail for more than a week ]
-fmove-all-movables and -freduce-all-givs are mostly beneficial for code
that looks a lot like most Fortran code: Subroutines with large nested
loops over multiple multi-rank arrays that are arguments to the routine.
It turns out that the heuristic to prevent register spills due to too
many registers being necessary to hold induction variables and loop
invariants is actually off in the case mentioned above.
Both flags force the compiler to bypass the heuristic.
I hope this helps,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)