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

Safe Haskell | Safe-Inferred
Language | GHC2021

Futhark.Analysis.PrimExp.Simplify

Description

Defines simplification functions for `PrimExp`s.

Synopsis

- simplifyPrimExp :: SimplifiableRep rep => PrimExp VName -> SimpleM rep (PrimExp VName)
- simplifyExtPrimExp :: SimplifiableRep rep => PrimExp (Ext VName) -> SimpleM rep (PrimExp (Ext VName))

# Documentation

simplifyPrimExp :: SimplifiableRep rep => PrimExp VName -> SimpleM rep (PrimExp VName) Source #

Simplify a `PrimExp`, including copy propagation. If a `LeafExp` refers to a name that is a `Constant`, the node turns into a `ValueExp`.

simplifyExtPrimExp :: SimplifiableRep rep => PrimExp (Ext VName) -> SimpleM rep (PrimExp (Ext VName)) Source #

Like `simplifyPrimExp`, but where leaves may be `Ext`s.