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: -fmove-all-movables and -freduce-all-givs


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)


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