Controls optimization for one function or all functions after its first occurrence.
- Indicates the interpretation to use
- An integer value specifying an optimization level; valid values are:
- 0: same optimizations as option-O0(Linux*and) ormacOS*/Od(Windows*)
- 1: same optimizations as optionO1
- 2: same optimizations as optionO2
- 3: same optimizations as optionO3
optimization_levelpragma is used to restrict optimization for a specific function while optimizing the remaining application using a different, higher optimization level. For example, if you specify option level
O3for the application and specify
#pragma optimization_level 1, the marked function will be optimized at option level
O1, while the remaining application will be optimized at the higher level.
In general, this pragma optimizes the function at the level specified as
n; however, certain compiler optimizations, like Inter-procedural Optimization (IPO), are not enabled or disabled during translation unit compilation. For example, if you enable IPO and a specific optimization level, IPO is enabled even for the function targeted by this pragma; however, IPO might not be fully implemented regardless of the optimization level specified at the command line. The reverse is also true.
Scope of optimization restriction
andsystems, the scope of the opti