Re: Loop unrolling



On Wed, 23 Apr 2008 08:51:41 -0400, Walter Banks wrote:

We have looked at a lot of customer embedded system code related to loop
unrolling and eventually concluded that best thing that we could do in
our compilers was to compile the code as written.

Application code usually was very clear and almost always right in their
timing choice of straight line vs loop implementation. Rolling up
straight line code and unrolling loops more often than not interfered
with a conscience choice a developer made.

Refreshing viewpoint. Maybe like in Java and C# the user could add
comment tags to provide hints, compiler specific, if the compiler used
didn't recognize the tags, they just get ignored so the code remains
compilable across vendor's compilers, but the ones that do recognize them
enables the compiler to attempt to zing the code.

This lets the user become a more active participant, helping guide the
compiler's decisions rather than a less granular command line option
indicating an optimization preference.

--
// This is my opinion.
.



Relevant Pages

  • Re: Matrix optimization
    ... With unrolling, it seems like the gcc compiler likes the ... time ./matrix_add pointers ... The compiler does a pretty bad job of unrolling index loops! ... template <typename T, int Rows, int Cols> ...
    (comp.lang.cpp)
  • Re: Conficker C and Ron Rivest
    ... the compiler job easy). ... registers and opcodes, which is done in pure assembly. ... So, unrolling or not, it had to wait for the ... I now get my 284 MB/s on the Core2. ...
    (sci.crypt)
  • Re: duffs device / loop unriolling
    ... > With a modern, optimising compiler, it's bad idea. ... > Compilers can do unrolling for you. ... the loop body that is being unrolled is ... The technique of incrementing i by 8, and using 'i+0', etc, ...
    (comp.lang.c)
  • Re: VC code output SUX !
    ... There's a good chance you broke something when unrolling - there *are* ... however a few known bugs in Visual C++. ... I'd be interested in seeing a small piece of reproducable code (along with ... compiler version and compile flags) that produces the b0rked code. ...
    (alt.lang.asm)
  • Re: OT: C++ overloading operators
    ... unless a compiler is really good at some unrolling (& ... essentially "vectorizing" the code). ... architecture is an architecture where there at any one time are ... be difficult (or the compiler might not be that good at it). ...
    (comp.dsp)