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

Futhark.Analysis.PrimExp.Table

Description

Compute a mapping from variables to their corresponding (fully expanded) PrimExps.

Synopsis

Documentation

type PrimExpTable = Map VName (Maybe (PrimExp VName)) Source #

Maps variables to maybe PrimExps. Will map to nothing if it cannot be resolved to a PrimExp. For all uses of this analysis atm. a variable can be considered inscrutable if it cannot be resolved to a primexp.

Extensibility

class PrimExpAnalysis rep where Source #

A class for extracting PrimExps from what is inside an op.

Methods

opPrimExp :: Scope rep -> Op rep -> State PrimExpTable () Source #

Instances

Instances details
PrimExpAnalysis GPU Source # 
Instance details

Defined in Futhark.Analysis.PrimExp.Table

PrimExpAnalysis MC Source # 
Instance details

Defined in Futhark.Analysis.PrimExp.Table

Testing

stmToPrimExps :: forall rep. (PrimExpAnalysis rep, RepTypes rep) => Scope rep -> Stm rep -> State PrimExpTable () Source #

Adds a statement to the PrimExpTable. If it can't be resolved as a PrimExp, it will be added as Nothing.