From: Yannick Duchêne (Hibou57) on
Le Thu, 17 Jun 2010 09:44:27 +0200, Gautier write-only
<gautier_niouzes(a)hotmail.com> a écrit:
> Just a note for those who are not aware of and who'd be tempted to
> unroll loops by hand: compilers are able to unroll loops themselves.
> For instance GNAT has a -funroll-loops for a long time (and also -
> fpeel-loops and -funswitch-loops).
Either by hand or by compiler optimizer, loop unroll does not assure
better performance, and had even been noticed to give less better
performance.

--
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
-- i.e. forget about previous premises which leads to conclusion
-- and start with new conclusion as premise.
From: Colin Paul Gloster on
On Thu, 17 Jun 2010, Yannick Duchêne (Hibou57) wrote:
|---------------------------------------------------------------------------|
|"Le Thu, 17 Jun 2010 09:44:27 +0200, Gautier write-only |
|<gautier_niouzes(a)hotmail.com> a écrit: |
|> Just a note for those who are not aware of and who'd be tempted to |
|> unroll loops by hand: compilers are able to unroll loops themselves. |
|> For instance GNAT has a -funroll-loops for a long time (and also - |
|> fpeel-loops and -funswitch-loops). |
|Either by hand or by compiler optimizer, loop unroll does not assure better|
|performance, and had even been noticed to give less better performance." |
|---------------------------------------------------------------------------|

True, and you could say that about many techniques which sometimes
achieve optimzation.