Next: MLDS back-end (MLDS -> MLDS) optimization options, Previous: Overall optimization options, Up: Optimization options [Contents][Index]
These optimizations are high-level transformations on our HLDS (high-level data structure).
--no-inliningDisable all forms of inlining.
--no-inline-simpleDisable the inlining of simple procedures.
--no-inline-builtinsGenerate builtins (e.g. arithmetic operators) as calls to out-of-line procedures. This is done by default when debugging, as without this option the execution of builtins is not traced.
--no-inline-single-useDisable the inlining of procedures called only once.
--inline-compound-threshold thresholdInline a procedure if its size (measured roughly in terms of the number of connectives in its internal form), multiplied by the number of times it is called, is below the given threshold.
--inline-simple-threshold thresholdInline a procedure if its size is less than the given threshold.
--intermod-inline-simple-threshold thresholdSimilar to –inline-simple-threshold, except used to determine which predicates should be included in ‘.opt’ files. Note that changing this between writing the ‘.opt’ file and compiling to C may cause link errors, and too high a value may result in reduced performance.
--inline-vars-threshold thresholdDon’t inline a call if it would result in a procedure containing more than threshold variables. Procedures containing large numbers of variables can cause slow compilation.
--inline-linear-tail-rec-sccsGiven a set of mutually recursive procedures (an SCC, or strongly connected component, of the call graph) in which each procedure contains exactly tail call to a procedure in the SCC, so that the tail recursive calls form a linear chain through the SCC, inline the callee at every one of those mutually tail recursive call sites. This converts mutual tail recursion into self tail recursion, which the MLDS backend can turn into code that runs in constant stack space.
--loop-invariantsOptimize loop invariants by moving computations within a loop that are the same on every iteration to the outside so they are only calculated once.
--no-common-structDisable optimization of common term structures.
--constraint-propagationEnable the constraint propagation transformation, which attempts to transform the code so that goals which can fail are executed as early as possible.
--local-constraint-propagationEnable the constraint propagation transformation, but only rearrange goals within each procedure. Specialized versions of procedures will not be created.
--no-follow-codeDon’t migrate builtin goals into branched goals.
--optimize-unused-argsRemove unused predicate arguments. The compiler will generate more efficient code for polymorphic predicates.
--intermod-unused-argsPerform unused argument removal across module boundaries. This option implies ‘--optimize-unused-args’ and ‘--intermodule-optimization’.
--unneeded-codeRemove goals from computation paths where their outputs are not needed, provided the language semantics options allow the deletion or movement of the goal.
--unneeded-code-copy-limit limitGives the maximum number of places to which a goal may be copied when removing it from computation paths on which its outputs are not needed. A value of zero forbids goal movement and allows only goal deletion; a value of one prevents any increase in the size of the code.
--optimize-higher-orderSpecialize calls to higher-order predicates where the higher-order arguments are known.
--type-specializationSpecialize calls to polymorphic predicates where the polymorphic types are known.
--user-guided-type-specializationEnable specialization of polymorphic predicates for which there are ‘pragma type_spec’ declarations. See the “Type specialization” section in the “Pragmas” chapter of the Mercury Language Reference Manual for more details.
--higher-order-size-limit limitSet the maximum goal size of specialized versions created by ‘--optimize-higher-order’ and ‘--type-specialization’. Goal size is measured as the number of calls, unifications and branched goals.
--higher-order-arg-limit limitSet the maximum size of higher-order arguments to be specialized by ‘--optimize-higher-order’ and ‘--type-specialization’.
--optimize-constant-propagationEvaluate constant expressions at compile time.
--introduce-accumulatorsAttempt to introduce accumulating variables into procedures, so as to make the procedure tail recursive.
--optimize-constructor-last-callEnable the optimization of “last” calls that are followed by constructor application.
--optimize-dead-procsEnable dead procedure elimination.
--excess-assignRemove excess assignment unifications.
--no-optimize-format-callsDo not attempt to interpret the format string in calls to string.format and related predicates at compile time; always leave this to be done at runtime.
--optimize-duplicate-callsOptimize away multiple calls to a predicate with the same input arguments.
--delay-constructsReorder goals to move construction unifications after primitive goals that can fail.
--optimize-saved-varsMinimize the number of variables that have to be saved across calls.
--deforestationEnable deforestation. Deforestation is a program transformation whose aim is to avoid the construction of intermediate data structures and to avoid repeated traversals over data structures within a conjunction.
--deforestation-depth-limit limitSpecify a depth limit to prevent infinite loops in the deforestation algorithm. A value of -1 specifies no depth limit. The default is 4.
--deforestation-vars-threshold thresholdSpecify a rough limit on the number of variables in a procedure created by deforestation. A value of -1 specifies no limit. The default is 200.
--deforestation-size-threshold thresholdSpecify a rough limit on the size of a goal to be optimized by deforestation. A value of -1 specifies no limit. The default is 15.
--analyse-exceptionsTry to identify those procedures that cannot throw an exception. This information can be used by some optimization passes.
--analyse-trail-usageEnable trail usage analysis. Identify those procedures that will not modify the trail. This information is used to reduce the overhead of trailing.
--analyse-mm-tablingIdentify those goals that do not calls procedures that are evaluated using minimal model tabling. This information is used to reduce the overhead of minimal model tabling.
Next: MLDS back-end (MLDS -> MLDS) optimization options, Previous: Overall optimization options, Up: Optimization options [Contents][Index]