From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f57db,6d2f6f79a5d77470 X-Google-Attributes: gidf57db,public X-Google-Thread: 1164f8,6d2f6f79a5d77470 X-Google-Attributes: gid1164f8,public X-Google-Thread: 110292,6d2f6f79a5d77470 X-Google-Attributes: gid110292,public From: Achim Gratz Subject: Re: Final results of portable benchmark for single, SMP and MPP computers Date: 1997/04/15 Message-ID: #1/1 X-Deja-AN: 234966964 Sender: gratz@ite127.inf.tu-dresden.de References: <5inufv$llo@news-rocq.inria.fr> Organization: Institute of Computer Engineering, CS department, TU Dresden, Germany Newsgroups: comp.benchmarks,comp.sys.dec,comp.sys.intel Jeffrey Potoff writes: > I was under the impression that the compilers were doing this for > you when you ran the -O5 flag in f90 (loop unrolling and > software pipelining). Maybe I'm being rather naive about this, > but unless you've written terrible code, is there much to be > gained by manually unrolling all the loops instead of letting the > compiler do it for you ? It helps with dumb compilers. It helps with smart compilers too, if you know more than the compiler can possibly know. For instance if you limit the lifetime of temporaries by putting them in their own scope, the compiler may get the message that there is no dependence to other iterations of the loop and optimize more aggressively. The code I commented on was written in C, where there are much weaker guarantees about aliasing than FORTRAN provides. Compilers (for RISC machines, anyway) are pretty smart about unrolling these days, you'll be hard pressed to find an example where you can outdo the compiler unless it didn't grok the independence of iterations. If you find that your compilers doesn't pipeline as much as you wish even if you nudge it by reformulating the source, you have only assembler and m4 as last ressorts. Achim Gratz. --+<[ It's the small pleasures that make life so miserable. ]>+-- WWW: http://www.inf.tu-dresden.de/~ag7/{english/} E-Mail: gratz@ite.inf.tu-dresden.de Phone: +49 351 463 - 8325