Re: Compiler Loop Unswitching





Tim Frink wrote:

Hi,

I'd like to know your experiences with compiler loop optimizations.

What loop optimizations (in your opinion) can be applied to a large
number of programs and yield a (significant) improvement of the
program run-time?

I've tested the compiler optimization "loop unswitching" (also introduced
in gcc 3.4) but going through a large number of different benchmarks I
could find very few examples where the optimization could be applied. Do
you share my experience?

Loop unswitching is one of a class of optimizations that quite rare
in application code.

Based on our metrics the single most important loop optimization
on application code is moving the test to the bottom when the first
compare is known at compile time. It halves the pipe line flushes
and is almost trivial to implement.

Regards,

--
Walter Banks
Byte Craft Limited
Tel. (519) 888-6911
http://www.bytecraft.com
walter@xxxxxxxxxxxxx




.



Relevant Pages

  • Re: code optimization
    ... > A reasonable compiler will avoid this. ... few loop optimizations on it. ... Hand doing the optimizations may actually wind ... www.digitalmars.com free C, C++, D programming language compilers ...
    (comp.lang.c)
  • Compiler Loop Optimizations
    ... I'd like to know your experiences with compiler loop optimizations. ... number of programs and yield a improvement of the ...
    (comp.compilers)
  • Compiler Loop Unswitching
    ... I'd like to know your experiences with compiler loop optimizations. ... number of programs and yield a improvement of the ...
    (comp.programming)
  • Loop Optimizations
    ... I'd like to know your experiences with compiler loop optimizations. ... number of programs and yield a improvement of the ...
    (comp.dsp)