Next: Source-to-source optimizations, Up: Optimization options [Contents][Index]
-O N
--optimization-level N
--optimisation-level N
--opt-level N
Set optimization level to N. Optimization level -1 means no optimization while optimization level 6 means full optimization. The option ‘--output-optimization-options’ lists the optimizations enabled at each level.
Note that some options are not enabled automatically at any optimization level. These include options that are too new and experimental for large scale use, and options that generate speedups in some use cases, but slowdowns in others, require situation-specific consideration of their use.
Likewise, if you want the compiler to perform intermodule
optimizations, where the compiler exploits information about the
non-public parts of the modules it imports (which it gets from their
.opt files) for optimization purposes then you must enable that
separately, partially because they affect the compilation process in
ways that require special treatment by mmake
. This goes double
for transitive intermodule optimizations, where the compiler
exploits information about the non-public parts of not just the modules
it imports, but also from the modules that they) import,
directly or indirectly. (It gets this info from the .trans_opt
files of the directly or indirectly imported modules.)
--optimize-space
--optimise-space
--opt-space
Turn on optimizations that reduce code size, and turn off optimizations that significantly increase code size.