Advanced Optimizations Options dialog box

To get to this dialog box, do this:

  1. From the Builder, choose Project > Options for Selected Files....
  2. Choose the Optimization tab.
  3. Choose either "Optimize for size" or "Optimize for speed".
  4. Click Advanced...

Many of the options in this window automatically set other options in this window. Use Merge to display the fully resolved option settings. The following table shows the name of the section in the Language User's Guides dealing with the given optimization:
Optimization
Section
Inline
Inlining Enabled with -OI
Loop
Loop Optimizations Enabled with -OL

The following table shows the minor optimizations and the corresponding command line option. Refer to the description of optimization control in the processor specific Development Guide for more information.
Minor Optimization Command Line Option
Peephole
-Onopeep
Common subexpression elimination
-Onocse
Constant propagation
-Onoconstprop
Unroll loops
-Onounroll
Recognize min, max, abs expressions
-Onominmax
Pipeline scheduling
-Onopipeline
Inline strcpy() and strcmp() calls
-Onostrcpy
Tail recursion
-Onotailrecursion
Unroll loops up to 8 times
-Ounroll8
Unroll bigger loops
-Ounrollbig
Pipeline only within source line
-Olimit=pipeline
Peephole only within source line
-Olimit=peephole

The optimizations in the following table have an associated command line option in the "register allocation by coloring" description in the Language User's Guide:
Minor Optimization Command Line Option
Allocate auto variables in registers
-autoregister
Overload variables in registers
-overload

The first table of optimizations contains all major categories, while the second and third tables contain minor optimizations. Turning on some of the major optimizations automatically turns on some of the minor optimizations. The minor optimization boxes are not altered to reflect their new state. To see the final state of the minor optimizations, use the Merge button in the Builder window. The following table explains the state of minor optimizations:
Minor Optimization State
Overload registers
Auto register
Always on, unless forced off.
Loop unrolling
Implied by Loop optimization.
Unroll 8
Unroll Big
Requires Loop optimization, but always off unless forced on.
All others
Always off, unless forced on.

Most of the time, you will be turning off optimizations, since Optimize for size and Optimize for speed turn on most optimizations by default. The minor optimizations are useful in special circumstances.

The textfields allow you to enter additional information about the corresponding optimizations. For example, you may enter functions to inline in the Inline textfield, and functions to loop-optimize in the Loop textfield.

There are three ways to use the Inline field.

The Loop option works differently. If you click the checkbox, then all functions will have loop optimizations applied, overriding any functions listed in the textfield. So, if you enter any specific functions in the textfield, do not click the checkbox to the left.

Note: Not all optimizations are supported for all targets.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.