Plinth Compiler Options
These options can be passed to the compiler via the OPTIONS_GHC
pragma, for instance
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:dump-uplc #-}
{-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:max-simplifier-iterations-uplc=3 #-}
For each boolean option, you can add a no-
prefix to switch it off, such as no-typecheck
, no-simplifier-beta
.
Option | Value Type | Default | Description |
---|---|---|---|
certify | Maybe [Char] | Produce a certificate for the compiled program, with the given name. This certificate provides evidence that the compiler optimizations have preserved the functional behavior of the original program. Currently, this is only supported for the UPLC compilation pipeline. Warning: this is an experimental feature and may not work as expected. | |
conservative-optimisation | Bool | False | When conservative optimisation is used, only the optimisations that never make the program worse (in terms of cost or size) are employed. Implies no-relaxed-float-in , no-inline-constants , no-inline-fix , no-simplifier-evaluate-builtins , and preserve-logging . |
context-level | Int | 1 | Set context level for error messages. |
coverage-all | Bool | False | Add all available coverage annotations in the trace output |
coverage-boolean | Bool | False | Add boolean coverage annotations in the trace output |
coverage-location | Bool | False | Add location coverage annotations in the trace output |
datatypes | DatatypeCompilationOpts | SumsOfProducts | Set datatype encoding style |
defer-errors | Bool | False | If a compilation error happens and this option is turned on, the compilation error is suppressed and the original Haskell expression is replaced with a runtime-error expression. |
dump-compilation-trace | Bool | False | Dump compilation trace for debugging |
dump-pir | Bool | False | Dump Plutus IR |
dump-tplc | Bool | False | Dump Typed Plutus Core |
dump-uplc | Bool | False | Dump Untyped Plutus Core |
inline-callsite-growth | Int | 5 | Sets the inlining threshold for callsites. 0 disables inlining a binding at a callsite if it increases the AST size; n allows inlining if the AST size grows by no more than n . Keep in mind that doing so does not mean the final program will be bigger, since inlining can often unlock further optimizations. |
inline-constants | Bool | True | Always inline constants. Inlining constants always reduces script costs slightly, but may increase script sizes if a large constant is used more than once. Implied by no-conservative-optimisation . |
inline-fix | Bool | True | Always inline fixed point combinators. This is generally preferable as it often enables further optimization, though it may increase script size. |
max-cse-iterations | Int | 4 | Set the max iterations for CSE |
max-simplifier-iterations-pir | Int | 12 | Set the max iterations for the PIR simplifier |
max-simplifier-iterations-uplc | Int | 12 | Set the max iterations for the UPLC simplifier |
optimize | Bool | True | Run optimization passes such as simplification and floating let-bindings. |
pedantic | Bool | False | Run type checker after each compilation pass |
preserve-logging | Bool | True | Turn off optimisations that may alter (i.e., add, remove or change the order of) trace messages. Implied by conservative-optimisation . |
profile-all | ProfileOpts | None | Set profiling options to All, which adds tracing when entering and exiting a term. |
relaxed-float-in | Bool | True | Use a more aggressive float-in pass, which often leads to reduced costs but may occasionally lead to slightly increased costs. Implied by no-conservative-optimisation . |
remove-trace | Bool | False | Eliminate calls to trace from Plutus Core |
simplifier-beta | Bool | True | Run a simplification pass that performs beta transformations |
simplifier-evaluate-builtins | Bool | True | Run a simplification pass that evaluates fully saturated builtin applications. Implied by no-conservative-optimisation . |
simplifier-inline | Bool | True | Run a simplification pass that performs inlining |
simplifier-remove-dead-bindings | Bool | True | Run a simplification pass that removes dead bindings |
simplifier-unwrap-cancel | Bool | True | Run a simplification pass that cancels unwrap/wrap pairs |
strictify-bindings | Bool | True | Run a simplification pass that makes bindings stricter |
target-version | Version | 1.1.0 | The target Plutus Core language version |
typecheck | Bool | True | Perform type checking during compilation. |
verbosity | Verbosity | Quiet | Set logging verbosity level (0=Quiet, 1=Verbose, 2=Debug) |