Increasing Code-Size Optimizations (--opt_for_space Option)

The --opt_for_space option increases the level of code-size optimizations performed by the compiler. These optimizations are done at the expense of performance. The optimizations include procedural abstraction where common blocks of code are replaced with function calls. For example, prolog and epilog code, certain intrinsics, and other common code sequences, can be replaced with calls to functions that are defined in the run-time library. It is necessary to link with the supplied run-time library when using the --opt_for_space option. It is not necessary to use optimization to invoke the --opt_for_space option.

To illustrate how the --opt_for_space option works, the following describes how prolog and epilog code can be replaced. This code is changed to function calls depending on the number of SOE registers, the size of the frame, and whether a frame pointer is used. These functions are defined in each file with the --opt_for_space option, as shown below:

_prolog_c28x_1 _prolog_c28x_2 _prolog_c28x_3 _epilog_c28x_1 _epilog_c28x_2

Example 6 provides an example of C code to be compiled with the --opt_for_space option. The resulting output is shown in Example 7.