Fortran patches

Jeffrey A Law law@cygnus.com
Sun Oct 26 08:37:00 GMT 1997


  In message <199710210620.XAA22570@cygnus.com>you write:
  > I went back looking for Fortran performance patches.  There seem to be 4 of
  > them.
  > 
  > Jeff Law's simplify_giv_expr patch
I just installed this -- it might be a temporary regression for
some processors, but I think we know how to fix the problems
(alias.c needs minor work, which I'll discuss with jfc and hopefully
clear up before the next snapshot).


  > Richard Henderson's get_inner_reference patch
Installed.

  > Toon Moene's fold patch
Pending the SAVE_EXPR issue -- I can't seem to find a copy easily
can someone send it to me?  Where exactly do we want to put the
SAVE_EXPR fix?

  > The only obvious problem I can see in them is that the fold patch does not
  > preserve SAVE_EXPRs.  There should be a little bit of code that does 
  > 	      if (have_save_expr)
  > 		t = save_expr (t);
  > We should not install this patch as is.  Otherwise, it does seem that it
  > should always give better code.

  > Richard Henderson's f/com.c patch
Installed.


I'd like to throw -frerun-loop into the mix -- here's why:

spec92 on the PA, with the simplify_giv_expr patch and changes to
the alias code to avoid regressions:

Without -frerun-loop:
  013.spice2g6            24000            456.1             52.6
  034.mdljdp2              7090             39.5            179.5
  039.wave5                3700             37.8             97.9
  078.swm256              12700            141.9             89.5
  089.su2cor              12900             59.0            218.6
  093.nasa7               16800            157.5            106.7
  094.fpppp                9200             55.1            167.0

With -frerun-loop:
  013.spice2g6            24000            349.4             68.7
  034.mdljdp2              7090             38.8            182.7
  039.wave5                3700             35.9            103.1
  078.swm256              12700            145.5             87.3
  089.su2cor              12900             58.3            221.3
  093.nasa7               16800            154.9            108.5
  094.fpppp                9200             56.0            164.3

You'll see that there were 2 small regressions (078.swm256 and 094.fpppp), but 
078.swm256 regressed because of register pressure -- we found an absurd
number of GIVs in the inner loop pair -- so many we ran out of regs
to hold them all and had to spill in the outer loop of the nest.

I suspect 094.fpppp is the same kind of problem.

Several improvements.  With this in mind I'm going to go ahead and
install -frerun-loop.

One might want to look into improving expand_iv_mult_add to emit
code that's more likely to expose some of the common subexpressions
which might help a little.


jeff



More information about the Gcc mailing list