clash-lib- CAES Language for Synchronous Hardware - As a Library

Safe HaskellNone



Transformations of the Normalization process



appProp :: NormRewriteSource

Propagate arguments of application inwards; except for Lam where the argument becomes let-bound.

bindNonRep :: NormRewriteSource

Inline non-recursive, non-representable let-bindings

liftNonRep :: NormRewriteSource

Lift recursive, non-representable let-bindings

caseLet :: NormRewriteSource

Lift the let-bindings out of the subject of a Case-decomposition

caseCon :: NormRewriteSource

Specialize a Case-decomposition (replace by the RHS of an alternative) if the subject is (an application of) a DataCon; or if there is only a single alternative that doesn't reference variables bound by the pattern.

caseCase :: NormRewriteSource

Move a Case-decomposition from the subject of a Case-decomposition to the alternatives

inlineNonRep :: NormRewriteSource

Inline function with a non-representable result if it's the subject of a Case-decomposition

typeSpec :: NormRewriteSource

Specialize functions on their type

nonRepSpec :: NormRewriteSource

Specialize functions on their non-representable argument

etaExpansionTL :: NormRewriteSource

Eta-expand top-level lambda's (DON'T use in a traversal!)

inlineClosedTerm :: String -> NormRewrite -> NormRewriteSource

Inline nullary/closed functions

nonRepANF :: NormRewriteSource

Bring an application of a DataCon or Primitive in ANF, when the argument is is considered non-representable

bindConstantVar :: NormRewriteSource

Inline let-bindings when the RHS is either a local variable reference or is constant

constantSpec :: NormRewriteSource

Specialise functions on arguments which are constant

makeANF :: NormRewriteSource

Turn an expression into a modified ANF-form. As opposed to standard ANF, constants do not become let-bound.

deadCode :: NormRewriteSource

Remove unused let-bindings

topLet :: NormRewriteSource

Ensure that top-level lambda's eventually bind a let-expression of which the body is a variable-reference.

inlineWrapper :: NormRewriteSource

Inline functions which simply "wrap" another function

recToLetRec :: NormRewriteSource

Turn a normalized recursive function, where the recursive calls only pass along the unchanged original arguments, into let-recursive function. This means that all recursive calls are replaced by the same variable reference as found in the body of the top-level let-expression.