8.123 --loop_optimization_level=opt

Trades code size for performance by controlling how much loop optimization the compiler performs.

The compiler can use several different techniques for specifically targeting loop optimizations, such as loop unrolling and inlining. However, these techniques can impact code size.

Syntax

--loop_optimization_level=opt

Where opt is one of:

0

Specifies that the compiler does not perform any loop optimization. This option is usually best for code size.

1

Specifies that the compiler performs some loop optimization. This option tries to balance code size and performance.

2

Specifies that the compiler performs high-level optimization, including aggressive loop optimization. This option is usually best for performance.

Restrictions

This option can only be used when both -O3 and -Otime options are given. That is:

armcc -O3 -Otime --loop_optimization_level=2 ...

Default

The default is 1.

Specifying -O3 -Otime implies --loop_optimization_level=1.

Related concepts
5.20 Inline functions
5.7 Loop unrolling in C code
Related reference
8.138 -Onum
8.142 -Otime
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.