11.07.2015 Views

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

MSP430 IAR C/C++ Compiler reference guide - Rice University

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Controlling compiler optimizationsspeed, whereas size will trade speed for size. Note that one optimization sometimesenables other optimizations to be performed, and an application may in some casesbecome smaller even when optimizing for speed rather than size.FINE-TUNING ENABLED TRANSFORMATIONSAt each optimization level you can disable some of the transformations individually. Todisable a transformation, use either the appropriate option, for instance the commandline option --no_inline, alternatively its equivalent in the <strong>IAR</strong> Embedded WorkbenchIDE Function inlining, or the #pragma optimize directive. The followingtransformations can be disabled:●●●●●Common subexpression eliminationLoop unrollingFunction inliningCode motionType-based alias analysis.Common subexpression eliminationRedundant re-evaluation of common subexpressions is by default eliminated atoptimization levels Medium and High. This optimization normally reduces both codesize and execution time. However, the resulting code might be difficult to debug.Note: This option has no effect at optimization levels None and Low.To read more about the command line option, see --no_cse, page 157.Loop unrollingIt is possible to duplicate the loop body of a small loop, whose number of iterations canbe determined at compile time, to reduce the loop overhead.This optimization, which can be performed at optimization level High, normallyreduces execution time, but increases code size. The resulting code might also bedifficult to debug.The compiler heuristically decides which loops to unroll. Different heuristics are usedwhen optimizing for speed, size, or when balancing between size and speed.Note: This option has no effect at optimization levels None, Low, and Medium.To read more about the command line option, see --no_unroll, page 159.122<strong>MSP430</strong> <strong>IAR</strong> C/<strong>C++</strong> <strong>Compiler</strong>Reference Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!