futhark-0.22.4: 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 :: FunDef (Aliases SeqMem) -> (Name, LUTabFun) Source #

Perform last-use analysis on a FunDef in SeqMem

lastUsePrg :: Prog (Aliases SeqMem) -> LUTabPrg Source #

Perform last-use analysis on a Prog in SeqMem

lastUsePrgGPU :: Prog (Aliases GPUMem) -> LUTabPrg Source #

Perform last-use analysis on a Prog in GPUMem

lastUseGPUMem :: FunDef (Aliases GPUMem) -> (Name, LUTabFun) Source #

Perform last-use analysis on a FunDef in GPUMem