Sorry to reply to my own post...

On Fri, Aug 7, 2009 at 11:32 PM, Raja Subramanian<[email protected]> wrote:
> In optimization parlance, this technique is called "constant folding".
>    http://en.wikipedia.org/wiki/Constant_folding

You could also classify it as a "loop invariant", ie, a value
which does not change throughout the runtime of the loop and
thus can be moved above the loop body.
    http://en.wikipedia.org/wiki/Loop-invariant_code_motion


This is also highlights one of the best things about optimization, any
number of optimization methods can be applied to a code block with
varying levels of success.

To help decide which optimization to use, modern compilers like
GCC, Intel compilers, and MS VC++ can use "profile guided optimization".
    http://blogs.msdn.com/vcblog/archive/2008/11/12/pogo.aspx

- Raja
_______________________________________________
To unsubscribe, email [email protected] with
"unsubscribe <password> <address>"
in the subject or body of the message.
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to