optimize
Syntax
#pragma optimize=[goal] [level] [vectorize] [disable]
Parameters
| Choose between:
|
| Specifies the level of optimization—choose between |
| Enables generation of NEON vector instructions. |
| Disables one or several optimizations (separated by spaces). Choose from:
|
Description
Use this pragma directive to decrease the optimization level, or to turn off some specific optimizations. This pragma directive only affects the function that follows immediately after the directive.
The parameters size, balanced, speed, and no_size_constraints only have effect on the high optimization level and only one of them can be used as it is not possible to optimize for speed and size at the same time. It is also not possible to use preprocessor macros embedded in this pragma directive. Any such macro will not be expanded by the preprocessor.
Note
If you use the #pragma optimize directive to specify an optimization level that is higher than the optimization level you specify using a compiler option, the pragma directive is ignored.
Example
#pragma optimize=speed
int SmallAndUsedOften()
{
/* Do something here. */
}
#pragma optimize=size
int BigAndSeldomUsed()
{
/* Do something here. */
}