5.6. Flag reference¶
This section is a quick-reference for GHC’s command-line flags. For each flag, we also list its mode/dynamic status (see Dynamic and Mode options), and the flag’s opposite (if available).
5.6.1. Verbosity options¶
More details in Verbosity options
Flag | Description | Type | Reverse |
---|---|---|---|
default: off. Toggles whether refinements where one or more of the holes are abstract are reported. |
dynamic |
||
Defer and group diagnostic messages by severity |
dynamic |
||
Output diagnostics in Json format specified by JSON schema |
dynamic |
||
Use colors in error messages |
dynamic |
||
Whether to show snippets of original source code |
dynamic |
||
Output full span in error messages |
dynamic |
||
hide module source and object paths |
dynamic |
||
Continue compilation as far as possible on errors |
dynamic |
||
default: 6. Set the maximum number of refinement hole fits for typed holes to display in type error messages. |
dynamic |
||
default: 6. Set the maximum number of bindings to display in type error messages. |
dynamic |
||
default: 6. Set the maximum number of valid hole fits for typed holes to display in type error messages. |
dynamic |
||
Disables showing a list of valid hole fits for typed holes in type error messages. |
dynamic |
||
Disables the sorting of the list of valid hole fits for typed holes in type error messages. |
dynamic |
||
Display equation incompatibilities in closed type families |
dynamic |
||
Distinguish between equality relations when printing |
dynamic |
||
Whether to emit diagnostic codes as ANSI hyperlinks to the Haskell Error Index. |
dynamic |
||
In type errors, also print type-synonym-expanded types. |
dynamic |
||
Print coercions in types |
dynamic |
||
Print explicit |
dynamic |
||
Print explicit kind foralls and kind arguments in types.
See also |
dynamic |
||
Print |
dynamic |
||
display all available instances in type error messages |
dynamic |
||
Print redundant |
dynamic |
||
Print extra information from typechecker. |
dynamic |
||
Use unicode syntax when printing expressions, types and kinds.
See also |
dynamic |
||
default: off. Sets the level of refinement of the
refinement hole fits, where level |
dynamic |
||
Output errors in reverse order |
dynamic |
||
Toggles whether to show the documentation of the valid hole fits in the output. |
dynamic |
||
Whether to show textual information about error context |
dynamic |
||
Show constraints when reporting typed holes. |
dynamic |
||
Toggles whether to show the type of the additional holes in refinement hole fits. |
dynamic |
||
Toggles whether to show the provenance of the valid hole fits in the output. |
dynamic |
||
Toggles whether to show the type application of the valid hole fits in the output. |
dynamic |
||
Toggles whether to show what type each quantified variable takes in a valid hole fit. |
dynamic |
||
Toggles whether to show the type of the valid hole fits in the output. |
dynamic |
||
Sort valid hole fits by size. |
dynamic |
||
Sort valid hole fits by subsumption. |
dynamic |
||
Unclutter the list of valid hole fits by not showing provenance nor type applications of suggestions. |
dynamic |
||
Summarise timing stats for GHC (same as |
dynamic |
||
verbose mode (equivalent to |
dynamic |
||
set verbosity level |
dynamic |
5.6.2. Alternative modes of operation¶
More details in Modes of operation
Flag | Description | Type | Reverse |
---|---|---|---|
run GHC with the given frontend plugin; see Frontend plugins for details. |
mode |
||
Display help |
mode |
||
display information about the compiler |
mode |
||
Interactive mode - normally used by just running |
mode |
||
Build a multi-module Haskell program, automatically figuring out
dependencies. Likely to be much easier, and faster, than using
|
mode |
||
display GHC version (numeric only) |
mode |
||
display bootstrap compiler version |
mode |
||
display platform on which GHC was built |
mode |
||
C compiler flags used to build GHC |
mode |
||
C linker flags used to build GHC |
mode |
||
print whether GHC was built with |
mode |
||
display GHC's global package database directory |
mode |
||
display whether GHC was built with interactive support |
mode |
||
display whether target platform has NCG support |
mode |
||
display host platform of GHC |
mode |
||
display linker flags used to compile GHC |
mode |
||
display use of leading underscores on symbol names |
mode |
||
display GHC library directory |
mode |
||
display whether GHC supports object splitting |
mode |
||
display Git commit id GHC is built from |
mode |
||
display GHC version |
mode |
||
display which way RTS was built |
mode |
||
display |
mode |
||
display whether GHC was compiled with SMP support |
mode |
||
display whether GHC was compiled with |
mode |
||
display target platform of GHC |
mode |
||
display whether this GHC was built in unregisterised mode |
mode |
||
Run a Haskell program. |
mode |
||
display the contents of an interface file. |
mode |
||
display the supported command line options |
mode |
||
display the supported language extensions |
mode |
||
display GHC version |
mode |
||
Evaluate |
mode |
||
generate dependency information suitable for use in a
|
mode |
||
Create a shared object. |
mode |
5.6.3. Which phases to run¶
More details in Batch compiler mode
Flag | Description | Type | Reverse |
---|---|---|---|
Merge a set of objects into a GHCi library. |
mode |
||
Stop after generating C ( |
mode |
||
Stop after generating object ( |
mode |
||
Stop after preprocessing ( |
mode |
||
Enable the use of a pre-processor
(set with |
dynamic |
||
Stop after generating assembly ( |
mode |
||
Override default behaviour for source files |
dynamic |
5.6.4. Redirecting output¶
More details in Redirecting the compilation output(s)
Flag | Description | Type | Reverse |
---|---|---|---|
Use ⟨file⟩ as the makefile |
dynamic |
||
Make dependencies that declare that files with suffix
|
dynamic |
||
redirect dump files |
dynamic |
||
set the suffix to use for dynamic interface files |
dynamic |
||
set dynamic output filename |
dynamic |
||
set the filename in which to put the dynamic interface |
dynamic |
||
set the dynamic output file suffix |
dynamic |
||
set the suffix to use for intermediate C files |
dynamic |
||
set directory for interface files |
dynamic |
||
set directory for extended interface files |
dynamic |
||
set the suffix to use for extended interface files |
dynamic |
||
set the suffix to use for interface files |
dynamic |
||
set output filename |
dynamic |
||
set directory for object files |
dynamic |
||
set the filename in which to put the interface |
dynamic |
||
set the output file suffix |
dynamic |
||
set output directory |
dynamic |
||
redirect FFI stub files |
dynamic |
5.6.5. Keeping intermediate files¶
More details in Keeping Intermediate Files
Flag | Description | Type | Reverse |
---|---|---|---|
Retain intermediate |
dynamic |
||
Retain intermediate |
dynamic |
||
Retain intermediate |
dynamic |
||
Retain intermediate LLVM |
dynamic |
||
Retain intermediate |
dynamic |
||
Retain intermediate |
dynamic |
||
Retain all intermediate temporary files. |
dynamic |
5.6.6. Temporary files¶
More details in Redirecting temporary files
Flag | Description | Type | Reverse |
---|---|---|---|
set the directory for temporary files |
dynamic |
5.6.7. Finding imports¶
More details in The search path
Flag | Description | Type | Reverse |
---|---|---|---|
Empty the import directory list |
dynamic |
||
add ⟨dir⟩, ⟨dir2⟩, etc. to import path |
dynamic |
5.6.8. Interface file options¶
More details in Other options related to interface files
Flag | Description | Type | Reverse |
---|---|---|---|
See Modes of operation. |
mode |
||
Dump the new interface to stdout |
dynamic |
||
Show the differences vs. the old interface |
dynamic |
||
Dump a minimal set of imports |
dynamic |
5.6.9. Extended interface file options¶
More details in Options related to extended interface files
Flag | Description | Type | Reverse |
---|---|---|---|
Perform some sanity checks on the extended interface files |
dynamic |
||
Write out extended interface files |
dynamic |
5.6.10. Recompilation checking¶
More details in The recompilation checker
Flag | Description | Type | Reverse |
---|---|---|---|
Regard |
dynamic |
||
Turn off recompilation checking. This is implied by any
|
dynamic |
||
Do not recompile modules just to match changes to HPC flags. This is especially useful for avoiding recompilation when using GHCi, and is enabled by default for GHCi. |
dynamic |
||
Do not recompile modules just to match changes to optimisation flags. This is especially useful for avoiding recompilation when using GHCi, and is enabled by default for GHCi. |
dynamic |
||
Include preprocessor dependencies |
dynamic |
||
Regard modules imported from packages as unstable |
dynamic |
5.6.11. Interactive-mode options¶
More details in The .ghci and .haskeline files
Flag | Description | Type | Reverse |
---|---|---|---|
dynamic |
|||
dynamic |
|||
dynamic |
|||
Set the number of entries GHCi keeps for |
dynamic |
||
(Debugging only) check for space leaks when loading new modules in GHCi. |
dynamic |
||
Put in scope qualified identifiers for every loaded module |
dynamic |
||
Use current directory for the GHCi command history
file |
dynamic |
||
No longer set the special variable |
dynamic |
||
dynamic |
|||
Instruct |
dynamic |
||
Show the names of modules that GHCi loaded after a
|
dynamic |
||
Read additional |
dynamic |
||
Disable reading of |
dynamic |
||
Select the function to use for printing evaluated expressions in GHCi |
dynamic |
5.6.12. Packages¶
More details in Packages
Flag | Description | Type | Reverse |
---|---|---|---|
Clear the package db stack. |
dynamic |
||
Expose package ⟨pkg⟩ and set it to be distrusted. See Safe Haskell. |
dynamic |
||
Distrust all packages by default. See Safe Haskell. |
dynamic |
||
Enable Safe Haskell trusted package requirement for trustworthy modules. |
dynamic |
||
Add the global package db to the stack. |
dynamic |
||
Hide all packages by default |
dynamic |
||
Hide package ⟨pkg⟩ |
dynamic |
||
Ignore package ⟨pkg⟩ |
dynamic |
||
Don't automatically link in the base and rts packages. |
dynamic |
||
Remove the global package db from the stack. |
dynamic |
||
Remove the user's package db from the stack. |
dynamic |
||
Expose package ⟨pkg⟩ |
dynamic |
||
Add ⟨file⟩ to the package db stack. |
dynamic |
||
Use the specified package environment. |
dynamic |
||
Expose package by id ⟨unit-id⟩ |
dynamic |
||
Compile to be part of unit (i.e. package) ⟨unit-id⟩ |
dynamic |
||
Expose package ⟨pkg⟩ and set it to be trusted. See Safe Haskell. |
dynamic |
||
Add the user's package db to the stack. |
dynamic |
5.6.13. Language options¶
Language options can be enabled either by a command-line option
-Xblah
, or by a {-# LANGUAGE blah #-}
pragma in the file itself.
See Controlling editions and extensions.
5.6.14. Warnings¶
More details in Warnings and sanity-checking
Flag | Description | Type | Reverse |
---|---|---|---|
Generate warnings for Template Haskell splices |
dynamic |
||
Make suggestions for mis-spelled names. |
dynamic |
||
soft limit on the number of parallel models the pattern match checker should check a pattern match clause against |
dynamic |
||
show which group an emitted warning belongs to. |
dynamic |
||
use the C code generator |
dynamic |
||
enable normal warnings |
dynamic |
||
disable all warnings |
dynamic |
||
enable almost all warnings (details in Warnings and sanity-checking) |
dynamic |
||
warn when specialisation of any overloaded function fails. |
dynamic |
||
alias for |
dynamic |
||
warn about ambiguous field selectors or updates |
dynamic |
||
(deprecated) Does nothing |
dynamic |
||
warn when type binding is used at the wrong TH stage. |
dynamic |
||
enable future compatibility warnings (details in Warnings and sanity-checking) |
dynamic |
||
(deprecated) Report unqualified imports of core libraries which are expected to cause compatibility problems in future releases. |
dynamic |
||
warn on uses of the #if directive on undefined identifiers |
dynamic |
||
warn when an illegal use of a type or kind without
|
dynamic |
||
enable default flags |
dynamic |
||
warn when an Control.Exception.Context.ExceptionContext implicit parameter is defaulted to Control.Exception.Context.emptyExceptionContext. |
dynamic |
||
Report warnings when variable out-of-scope errors are
deferred until runtime.
See |
dynamic |
||
Report warnings when deferred type errors are enabled. This option is enabled by
default. See |
dynamic |
||
warn about uses of commandline flags that are deprecated |
dynamic |
||
warn when type abstractions in constructor patterns are used without enabling |
dynamic |
||
warn about uses of functions & types that have DEPRECATED pragmas,
or WARNING pragmas with the |
dynamic |
||
warn about default deriving when using both
|
dynamic |
||
warn when Typeable is derived |
dynamic |
||
warn about dodgy exports |
dynamic |
||
warn about dodgy foreign imports |
dynamic |
||
warn about dodgy imports |
dynamic |
||
warn when a constraint appears duplicated in a type signature |
dynamic |
||
warn when an entity is exported multiple times |
dynamic |
||
warn about enumerations that are empty |
dynamic |
||
make warnings fatal |
dynamic |
||
enable all warnings supported by GHC |
dynamic |
||
warn about uses of functions & types that have WARNING or DEPRECATED pragmas, across all categories |
dynamic |
||
alias for |
dynamic |
||
(deprecated) Does nothing |
dynamic |
||
warn when pattern matching on a GADT without MonoLocalBinds |
dynamic |
||
(deprecated)
warn when a |
dynamic |
||
warn about uses of Prelude numeric conversions that are probably the identity (and hence could be omitted) |
dynamic |
||
(deprecated) warn when kind variables are implicitly quantified over. |
dynamic |
||
warn about implicit |
dynamic |
||
warn when the Prelude is implicitly imported |
dynamic |
||
warn when type variables on the RHS of a type synonym are implicitly quantified |
dynamic |
||
warn about inaccessible code |
dynamic |
||
warn when some but not all of exports for a name are warned about |
dynamic |
||
warn when a pattern match could fail |
dynamic |
||
warn when a record selector application could fail |
dynamic |
||
warn when a record update could fail |
dynamic |
||
warn when a pattern match in a lambda expression, pattern binding or a lazy pattern could fail |
dynamic |
||
warn when command line options are inconsistent in some way. |
dynamic |
||
warn when an explicitly Safe Haskell module imports a Safe-Inferred one |
dynamic |
||
Warn if a rewrite RULE might fail to fire because the function might be inlined before the rule has a chance to fire. See How rules interact with INLINE/NOINLINE pragmas. |
dynamic |
||
warn when a Haddock comment occurs in an invalid position |
dynamic |
||
(deprecated) warn when creating potentially-loopy superclass constraint evidence |
dynamic |
||
warn about uses of file header pragmas in the module body |
dynamic |
||
Warn when GHCi can't load a shared lib. |
dynamic |
||
warn when specialisation of an imported, overloaded function fails. |
dynamic |
||
alias for |
dynamic |
||
warn when deriving without mentioning a deriving strategy |
dynamic |
||
warn when a module declaration does not explicitly list all exports |
dynamic |
||
warn about pattern synonyms without signatures, only if they are exported |
dynamic |
||
warn about top-level functions without signatures, only if they are exported |
dynamic |
||
(deprecated) warn about top-level functions without signatures, only if they are exported. takes precedence over -Wmissing-signatures |
dynamic |
||
warn when fields of a record are uninitialised |
dynamic |
||
warn when encountering a home module imported, but not listed
on the command line. Useful for cabal to ensure GHC won't pick
up modules, not listed neither in |
dynamic |
||
warn when an import declaration does not explicitly list all the names brought into scope |
dynamic |
||
warn when type declarations don't have kind signatures nor CUSKs |
dynamic |
||
warn about polymorphic local bindings without signatures |
dynamic |
||
(deprecated) warn about polymorphic local bindings without signatures |
dynamic |
||
warn when class methods are undefined |
dynamic |
||
(deprecated)
Warn when a failable pattern is used in a do-block that does
not have a |
dynamic |
||
warn when pattern synonyms do not have type signatures |
dynamic |
||
warn when inferred polykinded type or class declaration don't have kind signatures nor CUSKs |
dynamic |
||
warn when type declarations don't have role annotations |
dynamic |
||
warn when the Safe Haskell mode is not explicitly specified. |
dynamic |
||
warn about top-level functions without signatures |
dynamic |
||
(deprecated) Does nothing |
dynamic |
||
warn when the Monomorphism Restriction is applied |
dynamic |
||
warn when names are shadowed |
dynamic |
||
warn when |
dynamic |
||
(deprecated)
warn when |
dynamic |
||
warn when |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
warn on prefix, suffix, and tight infix uses of infix operators |
dynamic |
||
warn on uses of infix operators that would be parsed differently were a particular GHC extension enabled |
dynamic |
||
warn when the module contains orphan instance declarations or rewrite rules |
dynamic |
||
warn about literals that will overflow their type |
dynamic |
||
warn about overlapping patterns |
dynamic |
||
warn when defining a partial record field. |
dynamic |
||
warn about holes in partial type signatures when
|
dynamic |
||
Report imports with a leading/prepositive "qualified" |
dynamic |
||
Warn about redundant bang patterns. |
dynamic |
||
Have the compiler warn about redundant constraints in type signatures. |
dynamic |
||
Warn about record wildcard matches when the wildcard binds no patterns. |
dynamic |
||
Warn about redundant strictness flags. |
dynamic |
||
warn if the module being compiled is regarded to be safe. |
dynamic |
||
(deprecated)
Warn when a |
dynamic |
||
Warn about class constraints in a type signature that can be simplified using a top-level instance declaration. |
dynamic |
||
warn about binding the |
dynamic |
||
warn when |
dynamic |
||
warn if there are tabs in the source file |
dynamic |
||
warn when an implicitly quantified type variable captures a term's name |
dynamic |
||
warn if the module being compiled is marked as
|
dynamic |
||
warn when defaulting happens |
dynamic |
||
warn when type equality |
dynamic |
||
warn when type equality |
dynamic |
||
Report warnings when typed hole errors are
deferred until runtime. See
|
dynamic |
||
warn on pattern bind of unlifted variable that is neither bare nor banged |
dynamic |
||
warn about the usage of unicode bidirectional layout override characters |
dynamic |
||
warn about uses of pragmas that GHC doesn't recognise |
dynamic |
||
throw a warning when an unrecognised |
dynamic |
||
warn if the module being compiled is regarded to be unsafe. See Safe Haskell |
dynamic |
||
warn about use of an unsupported calling convention |
dynamic |
||
Warn when using |
dynamic |
||
warn if promoted constructors are not ticked |
dynamic |
||
warn about bindings that are unused. Alias for
|
dynamic |
||
warn about do bindings that appear to throw away values of types
other than |
dynamic |
||
warn about type variables in user-written
|
dynamic |
||
warn about unnecessary imports |
dynamic |
||
warn about local bindings that are unused |
dynamic |
||
warn about variables in patterns that aren't used |
dynamic |
||
warn when package is requested on command line, but not needed. |
dynamic |
||
warn about pattern match bindings that are unused |
dynamic |
||
Warn about record wildcard matches when none of the bound variables are used. |
dynamic |
||
warn about top-level bindings that are unused |
dynamic |
||
warn about unused type variables which arise from patterns in in type family and data family instances |
dynamic |
||
warn when a view pattern is used with type signature without explicit parens |
dynamic |
||
make warnings non-fatal |
dynamic |
||
warn about uses of functions & types that have DEPRECATED pragmas,
or WARNING pragmas with the |
dynamic |
||
warn about do bindings that appear to throw away monadic values that you should have bound instead |
dynamic |
||
warn about uses of functions & types that have WARNING pragmas with the given category |
dynamic |
5.6.15. Optimisation levels¶
These options are described in more detail in Optimisation (code improvement).
See Individual optimisations for a list of optimisations enabled on level 1 and level 2.
Flag | Description | Type | Reverse |
---|---|---|---|
Enable level 1 optimisations |
dynamic |
||
Disable optimisations (default) |
dynamic |
||
Enable level 2 optimisations |
dynamic |
||
Any -On where n > 2 is the same as -O2. |
dynamic |
5.6.16. Individual optimisations¶
These options are described in more detail in -f*: platform-independent flags. If a
flag is implied by -O
then it is also implied by -O2
(unless
flag description explicitly says otherwise). If a flag is implied by
-O0
only then the flag is not implied by -O
and -O2
.
Flag | Description | Type | Reverse |
---|---|---|---|
Enable shortcutting on assembly. Implied by |
dynamic |
||
default: 500K. Tweak assembly generator for binary blobs. |
dynamic |
||
Use the new cfg based block layout algorithm. Implied by |
dynamic |
||
Ignore cfg weights for code layout. |
dynamic |
||
Sets edge weights used by the new code layout algorithm. |
dynamic |
||
Enable call-arity optimisation. Implied by |
dynamic |
||
Enable constant folding in case expressions. Implied by |
dynamic |
||
Enable case-merging. Implied by |
dynamic |
||
Enable control flow optimisation in the Cmm backend. Implied by |
dynamic |
||
Enable Cmm common block elimination. Implied by |
dynamic |
||
Enable Cmm sinking. Implied by |
dynamic |
||
Enable static control flow prediction. Implied by |
dynamic |
||
Enable constant folding in Core. Implied by |
dynamic |
||
Turn on Constructed Product Result analysis. Implied by |
dynamic |
||
Turn on specialisation of overloaded functions imported from
other modules. Implied by |
dynamic |
||
Enable common sub-expression elimination. Implied by |
dynamic |
||
Make dictionary-valued expressions seem cheap to the optimiser. |
dynamic |
||
Make dictionaries strict. Implied by |
dynamic |
||
(deprecated) Use a special demand transformer for dictionary selectors. |
dynamic |
||
default: 3. Boxity analysis pretends that returned records with this many fields can be unboxed. |
dynamic |
||
Enable sophisticated argument eta-expansion. Implied by |
dynamic |
||
Enable eta-reduction. Always enabled by default. |
dynamic |
||
Enable lambda eta-expansion. Always enabled by default. |
dynamic |
||
Turn on eager blackholing |
dynamic |
||
Switch on all rewrite rules (including rules generated by
automatic specialisation of overloaded functions). Implied by
|
dynamic |
||
Enable excess intermediate precision |
dynamic |
||
Enables exitification optimisation. Implied by |
dynamic |
||
Expose all unfoldings, even for very large or recursive functions. |
dynamic |
||
Expose unfoldings carrying constraints, even for very large or recursive functions. |
dynamic |
||
Turn on the float-in transformation. Implied by |
dynamic |
||
Turn on full laziness (floating bindings outwards).
Implied by |
dynamic |
||
(deprecated) superseded by -ffull-laziness. |
dynamic |
||
Ignore assertions in the source. Implied by |
dynamic |
||
Ignore pragmas in interface files. Implied by |
dynamic |
||
Annotate methods of derived Generic and Generic1 instances with
INLINE[1] pragmas based on heuristics. Implied by |
dynamic |
||
Annotate methods of all derived Generic and Generic1 instances with INLINE[1] pragmas. |
dynamic |
||
Keep all "auto" rules, generated by specialisation |
dynamic |
||
Run demand analysis again, at the end of the simplification pipeline |
dynamic |
||
Run a late specialisation pass |
dynamic |
||
Turn on the liberate-case transformation. Implied by |
dynamic |
||
default: 2000. Set the size threshold for the liberate-case transformation to ⟨n⟩ |
dynamic |
||
(deprecated) Does nothing |
dynamic |
||
Enable local floating definitions out of let-binds. |
dynamic |
||
Enable local floating to float top-level bindings |
dynamic |
||
Turn saturated self-recursive tail-calls into local jumps in the
generated assembly. Implied by |
dynamic |
||
default: 333. Maximum number of value arguments for forced SpecConstr specializations. |
dynamic |
||
default: 128. Set the maximum size of inline array allocations to ⟨n⟩ bytes (default: 128). |
dynamic |
||
default: 32. Inline |
dynamic |
||
default: 32. Inline |
dynamic |
||
default: 4. Set the max iterations for the simplifier. |
dynamic |
||
default: 4. Set the maximum number of patterns to display in warnings about non-exhaustive ones. |
dynamic |
||
default: 10. Maximum number of value arguments for a worker. |
dynamic |
||
Turn off the coercion optimiser |
dynamic |
||
Turn off pre-inlining |
dynamic |
||
Turn off the state hackwhereby any lambda with a real-world state token as argument is considered to be single-entry. Hence OK to inline things inside it. |
dynamic |
||
Produce fully deterministic object code |
dynamic |
||
Don't generate interface pragmas. Implied by |
dynamic |
||
Omit heap checks when no allocation is being performed. |
dynamic |
||
Use a slower but better algorithm for ApplicativeDo |
dynamic |
||
Make GHC be more precise about its treatment of bottom (but see
also |
dynamic |
||
Allow specialisation to abstract over free type variables |
dynamic |
||
Use the graph colouring register allocator for register allocation in the native code generator. |
dynamic |
||
Use the iterative coalescing graph colouring register allocator in the native code generator. |
dynamic |
||
default: 100. Set the percentage factor for simplifier ticks. |
dynamic |
||
default: 2. Set the number of phases for the simplifier.
Ignored with |
dynamic |
||
When solving constraints, try to eagerly solve
super classes using available dictionaries. Implied by |
dynamic |
||
Turn on the SpecConstr transformation. Implied by |
dynamic |
||
default: 3.* Set to ⟨n⟩ the maximum number of specialisations that will be created for any one function by the SpecConstr transformation. |
dynamic |
||
Specialize a call with an explicit constructor argument, even if the argument is not scrutinised in the body of the function |
dynamic |
||
default: 2000. Set the size threshold for the SpecConstr transformation to ⟨n⟩. |
dynamic |
||
Turn on specialisation of overloaded functions. Implied by |
dynamic |
||
Turn on specialisation of overloaded functions regardless of size, if unfolding is available |
dynamic |
||
Enable specialisation on incoherent instances |
dynamic |
||
Turn on the static argument transformation. |
dynamic |
||
Enable common sub-expression elimination on the STG
intermediate language. Implied by |
dynamic |
||
Enable late lambda lifting on the STG intermediate
language. Implied by |
dynamic |
||
Allow turning known into unknown calls while performing late lambda lifting. |
dynamic |
||
Create top-level non-recursive functions with at most <n> parameters while performing late lambda lifting. |
dynamic |
||
Create top-level recursive functions with at most <n> parameters while performing late lambda lifting. |
dynamic |
||
Turn on demand analysis.
Implied by |
dynamic |
||
Run an additional demand analysis before simplifier phase ⟨n⟩ |
dynamic |
||
Flatten strict constructor fields with a pointer-sized
representation. Implied by |
dynamic |
||
Flatten strict constructor fields |
dynamic |
||
default: 30. Apply a penalty of (inlining_cost * 1/n) for each level of case nesting. |
dynamic |
||
default: 2. Reduce inlining for cases nested deeper than n. |
dynamic |
||
default: 750. Tweak unfolding settings. |
dynamic |
||
default: 30. Tweak unfolding settings. |
dynamic |
||
default: 60. Tweak unfolding settings. |
dynamic |
||
This has been deprecated in GHC 9.0.1. |
dynamic |
||
default: 90. Tweak unfolding settings. |
dynamic |
||
Enable the worker/wrapper transformation. Implied by |
dynamic |
||
Enable w/w splits for wrappers whos sole purpose is evaluating arguments. |
dynamic |
||
default: 2. Tweak the level of interface file compression. |
dynamic |
5.6.17. Profiling options¶
More details in Profiling
Flag | Description | Type | Reverse |
---|---|---|---|
(deprecated) Alias for |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
Do not collect entry counts |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Auto-add |
dynamic |
||
Process manual |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
Turn on profiling |
dynamic |
||
Turn on ticky-ticky profiling |
dynamic |
||
Track the number of times each closure type is allocated. |
dynamic |
||
Don't use standard AP thunks on order to get more reliable entry counters. |
dynamic |
||
Track allocations of dynamic thunks |
dynamic |
||
Treat join point binders similar to thunks/functions. |
dynamic |
||
Emit dummy ticky counters to record how many tag-inference checks tag inference avoided. |
dynamic |
5.6.18. Program coverage options¶
More details in Observing Code Coverage
Flag | Description | Type | Reverse |
---|---|---|---|
Turn on Haskell program coverage instrumentation |
dynamic |
||
Set the directory where GHC places |
dynamic |
5.6.19. C pre-processor options¶
More details in Options affecting the C pre-processor
Flag | Description | Type | Reverse |
---|---|---|---|
Run the C pre-processor on Haskell source files |
dynamic |
||
Define a symbol in the C pre-processor |
dynamic |
||
Add ⟨dir⟩ to the directory search list for |
dynamic |
||
Undefine a symbol in the C pre-processor |
dynamic |
5.6.20. Code generation options¶
More details in Options affecting code generation
Flag | Description | Type | Reverse |
---|---|---|---|
Build dynamic object files as well as static object files during compilation |
dynamic |
||
Use the native code generator |
dynamic |
||
Generate byte-code |
dynamic |
||
Generate object code and byte-code |
dynamic |
||
Produce symbols for all functions, including internal functions. |
dynamic |
||
Generate code for linking against dynamic libraries |
dynamic |
||
Compile using the LLVM code generator |
dynamic |
||
Omit code generation |
dynamic |
||
Generate object code |
dynamic |
||
Generate position-independent code (where available) |
dynamic |
||
Generate code for a position-independent executable (where available) |
dynamic |
||
Use byte-code if it is available to evaluate TH splices |
dynamic |
||
Write an interface file containing the simplified core of the module. |
dynamic |
||
Always write interface files |
dynamic |
5.6.21. Linking options¶
More details in Options affecting linking
Flag | Description | Type | Reverse |
---|---|---|---|
Stop after generating object ( |
mode |
||
Use the debugging runtime |
dynamic |
||
Set the install name (via |
dynamic |
||
Build dynamically-linked object files and executables |
dynamic |
||
Selects one of a number of modes for finding shared libraries at runtime. |
dynamic |
||
Enable runtime event tracing |
dynamic |
||
Instruct the linker to produce a __compact_unwind section. |
dynamic |
||
Do not garbage-collect CAFs (top-level expressions) at runtime |
dynamic |
||
Link the runtime when generating a shared or static library |
dynamic |
||
Do not embed the manifest in the executable (Windows only) |
dynamic |
||
Do not generate a manifest file (Windows only) |
dynamic |
||
Don't generate an import library for a DLL (Windows only) |
dynamic |
||
On Darwin/OS X/iOS only, link in the framework ⟨name⟩. This
option corresponds to the |
dynamic |
||
On Darwin/OS X/iOS only, add ⟨dir⟩ to the list of directories
searched for frameworks. This option corresponds to the |
dynamic |
||
Split sections for link-time dead-code stripping |
dynamic |
||
Set the rpath based on -L flags |
dynamic |
||
When linking a binary executable, this inserts the flag
|
dynamic |
||
Add ⟨dir⟩ to the list of directories searched for libraries |
dynamic |
||
Link in library ⟨lib⟩ |
dynamic |
||
Set main module and function |
dynamic |
||
Don't assume this program contains |
dynamic |
||
Don't instruct the linker to produce a position-independent executable. |
dynamic |
||
Don't print RTS suggestions about linking with
|
dynamic |
||
Expose package ⟨pkg⟩ |
dynamic |
||
Instruct the linker to produce a position-independent executable. |
dynamic |
||
This instructs the linker to add all symbols, not only used
ones, to the dynamic symbol table. Currently Linux and
Windows/MinGW32 only. This is equivalent to using
|
dynamic |
||
Control whether the RTS behaviour can be tweaked via command-line
flags and the |
dynamic |
||
Generate a shared library (as opposed to an executable) |
dynamic |
||
Use the single-threaded runtime |
dynamic |
||
Use static Haskell libraries |
dynamic |
||
Generate a standalone static library (as opposed to an executable). This is useful when cross compiling. The library together with all its dependencies ends up in in a single static library that can be linked against. |
dynamic |
||
Use the threaded runtime |
dynamic |
||
Set the default RTS options to ⟨opts⟩. |
dynamic |
5.6.22. Plugin options¶
More details in Compiler Plugins
Flag | Description | Type | Reverse |
---|---|---|---|
Clear the list of active plugins |
dynamic |
||
Load a pre-compiled static plugin from an external library |
dynamic |
||
Give arguments to a plugin module; module must be specified with
|
dynamic |
||
Trust the used plugins and no longer mark the compiled module as unsafe |
dynamic |
||
Load a plugin exported by a given module |
dynamic |
||
Hide all packages for plugins by default |
dynamic |
||
Expose ⟨pkg⟩ for plugins |
dynamic |
||
Expose ⟨pkg-id⟩ for plugins |
dynamic |
5.6.23. Replacing phases¶
More details in Replacing the program for one or more phases
Flag | Description | Type | Reverse |
---|---|---|---|
Use ⟨cmd⟩ as the assembler |
dynamic |
||
Use ⟨cmd⟩ as the C compiler |
dynamic |
||
Use ⟨cmd⟩ as the C-- C pre-processor |
dynamic |
||
Use ⟨cmd⟩ as the C++ compiler |
dynamic |
||
Use ⟨cmd⟩ as the pre-processor (with |
dynamic |
||
Use ⟨cmd⟩ as the external interpreter command. |
dynamic |
||
Use ⟨cmd⟩ as the program to inject |
dynamic |
||
Use ⟨cmd⟩ as the JavaScript C pre-processor (only for javascript-backend) |
dynamic |
||
Use ⟨cmd⟩ as the literate pre-processor |
dynamic |
||
Use ⟨cmd⟩ as the linker |
dynamic |
||
Use ⟨cmd⟩ as the LLVM assembler |
dynamic |
||
Use ⟨cmd⟩ as the LLVM compiler |
dynamic |
||
Use ⟨cmd⟩ as the linker when merging object files |
dynamic |
||
Use ⟨cmd⟩ as the LLVM optimiser |
dynamic |
||
Use ⟨cmd⟩ as the program to inspect mach-o dylibs on macOS |
dynamic |
||
Use ⟨cmd⟩ as the C pre-processor (with |
dynamic |
||
Use ⟨cmd⟩ as the splitter |
dynamic |
||
Use ⟨cmd⟩ as the program for embedding manifests on Windows. |
dynamic |
5.6.24. Forcing options to particular phases¶
More details in Forcing options to a particular phase
Flag | Description | Type | Reverse |
---|---|---|---|
pass ⟨option⟩ to the assembler |
dynamic |
||
pass ⟨option⟩ to the C compiler |
dynamic |
||
pass ⟨option⟩ to the C-- C pre-processor. |
dynamic |
||
pass ⟨option⟩ to the C++ compiler |
dynamic |
||
pass ⟨option⟩ to the custom pre-processor |
dynamic |
||
pass ⟨option⟩ to the interpreter sub-process. |
dynamic |
||
pass ⟨option⟩ to JavaScript C pre-processor (only for javascript-backend) |
dynamic |
||
pass ⟨option⟩ to the literate pre-processor |
dynamic |
||
pass ⟨option⟩ to the linker |
dynamic |
||
pass ⟨option⟩ to the LLVM assembler |
dynamic |
||
pass ⟨option⟩ to the LLVM compiler |
dynamic |
||
pass ⟨option⟩ to the linker when merging object files. |
dynamic |
||
pass ⟨option⟩ to the LLVM optimiser |
dynamic |
||
pass ⟨option⟩ to cpp (with |
dynamic |
||
pass ⟨option⟩ to |
dynamic |
||
(deprecated)
Indicate that the linker supports |
dynamic |
||
Indicate that the linker supports |
dynamic |
5.6.25. Platform-specific options¶
More details in Platform-specific Flags
Flag | Description | Type | Reverse |
---|---|---|---|
(x86 only) Enable support for AVX SIMD extensions |
dynamic |
||
(x86 only) Enable support for AVX2 SIMD extensions |
dynamic |
||
(x86 only) Enable support for AVX512-CD SIMD extensions |
dynamic |
||
(x86 only) Enable support for AVX512-ER SIMD extensions |
dynamic |
||
(x86 only) Enable support for AVX512-F SIMD extensions |
dynamic |
||
(x86 only) Enable support for AVX512-PF SIMD extensions |
dynamic |
||
(x86 only) Use BMI1 for bit manipulation operations |
dynamic |
||
(x86 only) Use BMI2 for bit manipulation operations |
dynamic |
||
Use native FMA instructions for fused multiply-add floating-point operations |
dynamic |
||
(x86 only) Use SSE for floating-point operations |
dynamic |
||
(x86 only) Use SSE2 for floating-point operations |
dynamic |
||
(x86 only) Use SSE3 for floating-point operations |
dynamic |
||
(x86 only) Use SSE4 for floating-point operations |
dynamic |
||
(x86 only) Use SSE4.2 for floating-point operations |
dynamic |
5.6.26. Compiler debugging options¶
More details in Debugging the compiler
Flag | Description | Type | Reverse |
---|---|---|---|
ASM pass sanity checking |
dynamic |
||
C-\- pass sanity checking |
dynamic |
||
Turn on internal sanity checking |
dynamic |
||
Disable the link with C sources compiled to JavaScript |
dynamic |
||
Generate pretty-printed JavaScript code instead of minified (compacted) code. |
dynamic |
||
Dump final assembly |
dynamic |
||
Dump register conflicts from the register allocator. |
dynamic |
||
Dump assembly augmented with register liveness |
dynamic |
||
Dump initial assembly |
dynamic |
||
Dump the result of register allocation |
dynamic |
||
Dump the build/spill stages of the |
dynamic |
||
Dump statistics from the register allocator. |
dynamic |
||
Dump interpreter byte code |
dynamic |
||
Dump C code produced by the C (unregisterised) backend. |
dynamic |
||
Dump output of the call arity analysis pass. |
dynamic |
||
Dump the assumed weights of the CFG. |
dynamic |
||
Dump the final C-\- output |
dynamic |
||
Dump the results of the C-\- CAF analysis pass. |
dynamic |
||
Dump the results of common block elimination |
dynamic |
||
Dump the results of the C-\- control flow optimisation pass. |
dynamic |
||
Dump the results of the CPS pass |
dynamic |
||
Dump STG-to-C-\- output |
dynamic |
||
Dump the results of the C-\- info table augmentation pass. |
dynamic |
||
Dump the results of C-\- to C-\- optimising passes |
dynamic |
||
Dump the results of proc-point analysis |
dynamic |
||
Dump the results of the C-\- proc-point map pass. |
dynamic |
||
Dump raw C-\- |
dynamic |
||
Dump the results of the C-\- sinking pass. |
dynamic |
||
Dump the results of the C-\- stack layout pass. |
dynamic |
||
Dump the results of the C-\- proc-point splitting pass. |
dynamic |
||
Dump the results of switch lowering passes |
dynamic |
||
Dump the results of the C-\- ThreadSanitizer elaboration pass. |
dynamic |
||
Write output from main C-\- pipeline passes to files |
dynamic |
||
Show output from main C-\- pipeline passes (grouped by proc) |
dynamic |
||
Print a one-line summary of the size of the Core program at the end of the optimisation pipeline |
dynamic |
||
Dump CPR signatures |
dynamic |
||
Dump CPR analysis output |
dynamic |
||
Trace constraint solver |
dynamic |
||
Dump CSE output |
dynamic |
||
Dump generated DWARF debug information |
dynamic |
||
Dump deriving output |
dynamic |
||
Dump top-level demand signatures |
dynamic |
||
Dump demand analysis output |
dynamic |
||
Dump desugarer output. |
dynamic |
||
Trace exhaustiveness checker |
dynamic |
||
Dump output of the exitification pass. |
dynamic |
||
Dump the whole FastString table when finished |
dynamic |
||
Set the prefix of the filenames used for debugging output. |
dynamic |
||
Dump float in output |
dynamic |
||
Dump |
dynamic |
||
Dump full laziness pass output |
dynamic |
||
Dump the hie file syntax tree |
dynamic |
||
An alias for |
dynamic |
||
Trace interface files |
dynamic |
||
Dump inlinings performed by the simplifier. |
dynamic |
||
Dump final JavaScript code |
dynamic |
||
(deprecated) Use |
dynamic |
||
Dump core with late cost centres added |
dynamic |
||
Dump liberate case output |
dynamic |
||
Dump LLVM intermediate code. |
dynamic |
||
Dump the state of the module mapping database. |
dynamic |
||
Dump occurrence analysis output |
dynamic |
||
Dump the results of C-\- to C-\- optimising passes |
dynamic |
||
Dump parse tree |
dynamic |
||
Dump parser output as a syntax tree |
dynamic |
||
Dump prepared core |
dynamic |
||
Dump renamer output |
dynamic |
||
Dump renamer output as a syntax tree |
dynamic |
||
Renamer stats |
dynamic |
||
Trace renamer |
dynamic |
||
Trace runtime type inference |
dynamic |
||
Dump rule firing info |
dynamic |
||
Dump detailed rule firing info |
dynamic |
||
Dump rewrite rules |
dynamic |
||
Dump final simplifier output |
dynamic |
||
Dump output from each simplifier iteration |
dynamic |
||
Dump simplifier stats |
dynamic |
||
Dump trace messages in simplifier |
dynamic |
||
Dump specialiser output |
dynamic |
||
Dump specialiser output from SpecConstr |
dynamic |
||
Dump TH spliced expressions, and what they evaluate to |
dynamic |
||
Dump static argument transformation output |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
Show output after Stg2Stg |
dynamic |
||
Show output of last STG pass. |
dynamic |
||
Show CoreToStg output |
dynamic |
||
Show output of the tag inference pass. |
dynamic |
||
Show unarised STG |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
(deprecated) Alias for |
dynamic |
||
Dump typechecker output |
dynamic |
||
Dump typechecker output as a syntax tree |
dynamic |
||
Trace typechecker |
dynamic |
||
Dump the code instrumented by HPC (Observing Code Coverage). |
dynamic |
||
Dump per-pass timing and allocation statistics |
dynamic |
||
Dump to files instead of stdout |
dynamic |
||
Dump type signatures |
dynamic |
||
Dump all considered inlinings |
dynamic |
||
Dump commoned view patterns |
dynamic |
||
Dump worker-wrapper output |
dynamic |
||
Show statistics for fast string usage when finished |
dynamic |
||
Print values of type Word# in hexadecimal. |
dynamic |
||
Start |
dynamic |
||
Dump information about inlining decisions |
dynamic |
||
Show statistics about IPE information |
dynamic |
||
Include comments in the parser. Useful in combination with |
dynamic |
||
Turn on internal sanity checking |
dynamic |
||
Enable several common internal sanity checkers |
dynamic |
||
Suppress unsolicited debugging output |
dynamic |
||
Don't generate bindings for Typeable methods |
dynamic |
||
Print single alternative case expressions as strict lets. |
dynamic |
||
Set the width of debugging output. For example |
dynamic |
||
Turn on debug printing (more verbose) |
dynamic |
||
Set the depth for printing expressions in error msgs |
dynamic |
||
Dump information about potential rule application |
dynamic |
||
Print out each pass name as it happens |
dynamic |
||
STG pass sanity checking |
dynamic |
||
In dumps, suppress everything (except for uniques) that is suppressible. |
dynamic |
||
Suppress the printing of coercion types in Core dumps to make them shorter |
dynamic |
||
Suppress the printing of coercions in Core dumps to make them shorter |
dynamic |
||
Suppress the printing of core size stats per binding (since 9.4) |
dynamic |
||
Suppress extended information about identifiers where they are bound |
dynamic |
||
Suppress the printing of module qualification prefixes |
dynamic |
||
Suppress the printing of closure free variable lists in STG output |
dynamic |
||
Suppress rep annotations on STG args. |
dynamic |
||
Suppress "ticks" in the pretty-printer output. |
dynamic |
||
Suppress timestamps in dumps |
dynamic |
||
Suppress type applications |
dynamic |
||
Suppress type signatures |
dynamic |
||
Suppress the printing of the stable unfolding of a variable at its binding site |
dynamic |
||
Suppress the printing of uniques in debug output (easier to use
|
dynamic |
||
Suppress the printing of variable kinds |
dynamic |
||
Affirm tag inference results are correct at runtime. |
dynamic |
||
Dump evaluated TH declarations into *.th.hs files |
dynamic |
||
Set the increment for the generated |
dynamic |
||
Show output from each core-to-core pass |
dynamic |
||
Show output from each STG-to-STG pass |
dynamic |
||
Compile with alignment checks for all info table dereferences. |
dynamic |
||
Add a default |
dynamic |
||
Instrument array primops with bounds checks. |
dynamic |
||
Enable ThreadSanitizer instrumentation of memory accesses. |
dynamic |
||
Generate a fresh info table for each usage of a data constructor. |
dynamic |
||
Include the tag of the enabled ways in the extension of dump files. |
dynamic |
||
Embed a lookup table in the generated binary which maps the address of an info table to the source position the closure originated from. |
dynamic |
||
Include info tables with no source location information in the info table map. |
dynamic |
||
Include info tables for |
dynamic |
||
Intruct LLVM to fill dead STG registers with garbage |
dynamic |
||
Omit info tables with no source location information from the info table map. |
dynamic |
||
Omit info tables for |
dynamic |
||
Generate |
dynamic |
||
Align functions at given boundary. |
dynamic |
||
Disable optimizations with the interpreter |
dynamic |
||
Produce DWARF debug information in compiled object files. ⟨n⟩ can be 0, 1, or 2, with higher numbers producing richer output. If ⟨n⟩ is omitted, level 2 is assumed. |
dynamic |
5.6.27. Miscellaneous compiler options¶
Flag | Description | Type | Reverse |
---|---|---|---|
Dump module cycles |
dynamic |
||
Convert variable out of scope variables errors into warnings.
Implied by |
dynamic |
||
Turn type errors into warnings, deferring the error until
runtime. Implies
|
dynamic |
||
Convert typed hole errors into warnings,
deferring the error until runtime.
Implied by |
dynamic |
||
Run interpreted code in a separate process |
dynamic |
||
Use a cache when reducing type family applications |
dynamic |
||
Deprecated. Enable most language extensions; see Controlling editions and extensions for exactly which ones. |
dynamic |
||
Disable Safe Haskell |
dynamic |
||
(GHC as a C compiler only) Use this |
dynamic |
||
Set the minimum size of the heap to ⟨size⟩ |
dynamic |
||
A module which should not be visible outside its unit. |
dynamic |
||
When compiling with |
dynamic |
||
When compiling with |
dynamic |
||
A module which should be reexported from this unit. |
dynamic |
||
The name of the package which this module would be part of when installed. |
dynamic |
||
Specify the options to build a specific unit. |
dynamic |
||
Specify the directory a unit is expected to be compiled in. |
dynamic |