Methods to Optimize Code Size
This section provides some guidance on how to achieve smaller object and smaller executable size when using the optimizing features of Intel compilers.
To begin, there are two compiler options that are designed to prioritize code size over performance:
Favors size over speed
This option enables optimizations that do not increase code size; it produces smaller code size than option
Osdisables some optimizations that may increase code size for a small speed benefit.
Minimizes code size
Compared to option
O1disables even more optimizations that are generally known to increase code size. Specifying option
As an intermediate step in reducing code size, you can replace option
O2before specifying option
O1may improve performance for applications with very large code size, many branches, and execution time not dominated by code within loops.
For more information about the above options, see their full descriptions in the Compiler Reference.
The rest of this section briefly discusses methods that may help you further improve code size even when compared to the default behaviors of options
The following table summarizes the topics in this section.