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.
--intermodule-optimization
--intermodule-optimisation
--intermod-opt
Perform inlining, higher-order specialization, and other optimizations using knowledge of the otherwise non-public data of directly imported modules. The compiler gets this data from the module.opt files of the directly imported modules.
This option must be set consistently throughout the compilation
process, starting with mmc --generate-dependencies
.
--transitive-intermodule-optimization
--transitive-intermodule-optimisation
--trans-intermod-opt
Perform inlining, higher-order specialization, and other optimizations using knowledge of the otherwise non-public data of both directly and indirectly imported modules. The compiler gets this data from the module.trans_opt files of the directly and indirectly imported modules.
This option must be set consistently throughout the compilation
process, starting with mmc --generate-dependencies
.
Note that ‘--transitive-intermodule-optimization’ works only with
mmake
; it does not work with mmc --make
.
--no-read-opt-files-transitively
Only read the inter-module optimization information for directly imported modules, not the transitive closure of the imports.
--use-opt-files
Perform inter-module optimization using any .opt files which are already built, e.g. those for the standard library, but do not build any others.
--use-trans-opt-files
Perform inter-module optimization using any .trans_opt files which are already built, e.g. those for the standard library, but do not build any others.
--intermodule-analysis
Perform analyses such as termination analysis and unused argument elimination across module boundaries. This option is not yet fully implemented.
--analysis-repeat N
Specify the maximum number of times to repeat analyses of suboptimal
modules with ‘--intermodule-analysis’ (default: 0). (This option
works only with mmc --make
.)
Next: Source-to-source optimizations, Up: Optimization options [Contents][Index]