FORTRAN Optimization

James Zurlo jz0t+ at andrew.cmu.edu
Wed Jan 3 01:30:14 AEST 1990


I'm working on some FORTRAN code that takes between 2 and 3 CPU
days to execute on my Personal Iris.  Obviously, I'm interested
in cutting down execution time.  I've run pixie on my code and
found that ~90% of the time is spent in one subroutine.  I've
compiled this subroutine seperately with -O2 optimization level.
>From some crude timing tests that looks like it will cut execution
time in half.  I can't apply any optimization to the main code,
since it gives me wrong answers.  I think this is due to a
CALL statment that has a function as one its arguements.
I'm still interested in getting my execution time down.  I've been
reading through the IRIS-4D Series Compiler Guide.  It gives some
recommendations, most of which I don't understand since I know
no C.  I've also been reading "FORTRAN Optimization" by Michael
Metcalf.  It mentions a number of different ways of speeding up
my code.  It's not clear how his recommendations would change for
a RISC architecture.  By looking at the assembly language output,
I noticed that the optimizer does a good job with exponentiation.
However, the optimizer doesn't seem to do strength reduction.
Ie,  replacing divisions with multiplications, or subtractions
with additions.  Does DO loop unrolling, to reduce the number
of overheads per operation, buy one anything?  Does anyone have
any specific recommendations, from a FORTRAN perspective, that
I can use to speed up my code?
Thanks in advance.
Jim Zurlo
jz0t+ at andrew.cmu.edu



More information about the Comp.sys.sgi mailing list