morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Michelson.Optimizer.Internal.Rules

Description

Optimizer rewrite rules

Synopsis

Documentation

defaultRules :: Ruleset Source #

Default optimization rules.

defaultRulesAndPushPack :: Ruleset Source #

We do not enable pushPack rule by default because it is potentially dangerous. There are various code processing functions that may depend on constants, e. g. string transformations.

dipSwapDrop :: Rule Source #

NB: This rule MUST be applied AFTER all main stages, but BEFORE nested dips are rolled up

adjacentDrops :: Rule Source #

Sequences of DROPs can be turned into single DROP n. When n is greater than 2 it saves size and gas. When n is 2 it saves gas only.

removeExtStackType :: Rule Source #

STACKTYPE is currently a Nop and may safely be removed.

commuteArith :: forall n m s out. Instr (n ': (m ': s)) out -> Maybe (Instr (m ': (n ': s)) out) Source #