Skip to main content

Plutus Tx 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.

OptionValue TypeDefaultDescription
conservative-optimisationBoolFalseWhen 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-simplifier-evaluate-builtins, and preserve-logging.
context-levelInt1Set context level for error messages.
coverage-allBoolFalseAdd all available coverage annotations in the trace output
coverage-booleanBoolFalseAdd boolean coverage annotations in the trace output
coverage-locationBoolFalseAdd location coverage annotations in the trace output
defer-errorsBoolFalseIf 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-traceBoolFalseDump compilation trace for debugging
dump-pirBoolFalseDump Plutus IR
dump-tplcBoolFalseDump Typed Plutus Core
dump-uplcBoolFalseDump Untyped Plutus Core
inline-constantsBoolTrueAlways 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.
max-cse-iterationsInt4Set the max iterations for CSE
max-simplifier-iterations-pirInt12Set the max iterations for the PIR simplifier
max-simplifier-iterations-uplcInt12Set the max iterations for the UPLC simplifier
optimizeBoolTrueRun optimization passes such as simplification and floating let-bindings.
pedanticBoolFalseRun type checker after each compilation pass
preserve-loggingBoolFalseTurn off optimisations that may alter (i.e., add, remove or change the order of) trace messages. Implied by conservative-optimisation.
profile-allProfileOptsNoneSet profiling options to All, which adds tracing when entering and exiting a term.
relaxed-float-inBoolTrueUse 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-traceBoolFalseEliminate calls to trace from Plutus Core
simplifier-betaBoolTrueRun a simplification pass that performs beta transformations
simplifier-evaluate-builtinsBoolTrueRun a simplification pass that evaluates fully saturated builtin applications. Implied by no-conservative-optimisation.
simplifier-inlineBoolTrueRun a simplification pass that performs inlining
simplifier-remove-dead-bindingsBoolTrueRun a simplification pass that removes dead bindings
simplifier-unwrap-cancelBoolTrueRun a simplification pass that cancels unwrap/wrap pairs
strictify-bindingsBoolTrueRun a simplification pass that makes bindings stricter
target-versionVersion1.1.0The target Plutus Core language version
typecheckBoolTruePerform type checking during compilation.
verbosityVerbosityQuietSet logging verbosity level (0=Quiet, 1=Verbose, 2=Debug)