futhark-0.25.32: An optimising compiler for a functional, array-oriented language.

Safe Haskell | None
Language | GHC2021

Futhark.Optimise.Simplify.Rules.Simple

Description

Particularly simple simplification rules.

Synopsis

- type TypeLookup = SubExp -> Maybe Type
- type VarLookup rep = VName -> Maybe (Exp rep, Certs)
- applySimpleRules :: VarLookup rep -> TypeLookup -> BasicOp -> Maybe (BasicOp, Certs)

# Documentation

type TypeLookup = SubExp -> Maybe Type Source #

A function that, given a subexpression, returns its type.

type VarLookup rep = VName -> Maybe (Exp rep, Certs) Source #

A function that, given a variable name, returns its definition.

applySimpleRules :: VarLookup rep -> TypeLookup -> BasicOp -> Maybe (BasicOp, Certs) Source #

Try to simplify the given `BasicOp`, returning a new `BasicOp` and certificates that it must depend on.