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

Safe HaskellNone
LanguageHaskell2010

Futhark.Optimise.Simplify.Rules

Description

This module defines a collection of simplification rules, as per Futhark.Optimise.Simplify.Rule. They are used in the simplifier.

For performance reasons, many sufficiently simple logically separate rules are merged into single "super-rules", like ruleIf and ruleBasicOp. This is because it is relatively expensive to activate a rule just to determine that it does not apply. Thus, it is more efficient to have a few very fat rules than a lot of small rules. This does not affect the compiler result in any way; it is purely an optimisation to speed up compilation.

Synopsis

Documentation

standardRules :: (BinderOps lore, Aliased lore) => RuleBook lore Source #

A set of standard simplification rules. These assume pure functional semantics, and so probably should not be applied after memory block merging.

removeUnnecessaryCopy :: BinderOps lore => BottomUpRuleBasicOp lore Source #

Turn copy(x) into x iff x is not used after this copy statement and it can be consumed.

This simplistic rule is only valid before we introduce memory.