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

Futhark.Analysis.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.

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.