futhark-0.22.5: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Futhark.Optimise.ArrayShortCircuiting.LastUse

Description

Last use analysis for array short circuiting

Last-Use analysis of a Futhark program in aliased explicit-memory lore form. Takes as input such a program or a function and produces a 'M.Map VName Names', in which the key identified the let stmt, and the list argument identifies the variables that were lastly used in that stmt. Note that the results of a body do not have a last use, and neither do a function parameters if it happens to not be used inside function's body. Such cases are supposed to be treated separately.

This pass is different from Futhark.Analysis.LastUse in that memory blocks are used to alias arrays. For instance, an Update will not result in a last use of the array being updated, because the result lives in the same memory.

Synopsis

Documentation

lastUseSeqMem :: Prog (Aliases SeqMem) -> LUTabProg Source #

Perform last-use analysis on a Prog in SeqMem

lastUseGPUMem :: Prog (Aliases GPUMem) -> LUTabProg Source #

Perform last-use analysis on a Prog in GPUMem

lastUseMCMem :: Prog (Aliases MCMem) -> LUTabProg Source #

Perform last-use analysis on a Prog in MCMem

type LUTabFun = Map VName Names Source #

Maps a name indentifying a Stm to the last uses in that Stm.

type LUTabProg = (LUTabFun, Map Name LUTabFun) Source #

LU-table for the constants, and for each function.