There are two Go compilers.
The gc compiler (6g/8g) does not do any loop optimizations. One of the
major goals of that compiler is to compile quickly. While improved
optimization is always useful, it has to fit within that goal. Loop
unrolling could perhaps be done, but it's hard for me to imagine that
loop interchange or parallelization would be compatible with the goal of
a fast compiler. There may be some scope for Go-specific optimizations
when handling for loops with a range clause; I'm not sure.
The gccgo compiler is based on gcc which does a fairly extensive set of
loop optimizations, though it is not up to par with the very best
compilers. The gcc community is always interested in improving the loop
optimizations, but that work would be quite different from working on Go
itself. If you are interested in pursuing that, a good place to start
would be http://gcc.gnu.org/wiki/Graphite .
Ian
> Have you (or anyone else) done benchmarks comparing gc and gccgo? Perhaps
> with the shootout benchmarks?
http://golang.org/test/bench/timing.log
I've made some speedups to gccgo since the last runs, though, which are
fairly significant for some test cases.
Ian