Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A usage-table is sort of a bottom-up symbol table, describing how (and if) a variable is used.
Synopsis
- data UsageTable
- without :: UsageTable -> [VName] -> UsageTable
- lookup :: VName -> UsageTable -> Maybe Usages
- used :: VName -> UsageTable -> Bool
- expand :: (VName -> Names) -> UsageTable -> UsageTable
- isConsumed :: VName -> UsageTable -> Bool
- isInResult :: VName -> UsageTable -> Bool
- isUsedDirectly :: VName -> UsageTable -> Bool
- isSize :: VName -> UsageTable -> Bool
- usages :: Names -> UsageTable
- usage :: VName -> Usages -> UsageTable
- consumedUsage :: VName -> UsageTable
- inResultUsage :: VName -> UsageTable
- sizeUsage :: VName -> UsageTable
- sizeUsages :: Names -> UsageTable
- data Usages
- usageInStm :: (ASTLore lore, Aliased lore) => Stm lore -> UsageTable
Documentation
data UsageTable Source #
A usage table.
Instances
Eq UsageTable Source # | |
Defined in Futhark.Analysis.UsageTable (==) :: UsageTable -> UsageTable -> Bool # (/=) :: UsageTable -> UsageTable -> Bool # | |
Show UsageTable Source # | |
Defined in Futhark.Analysis.UsageTable showsPrec :: Int -> UsageTable -> ShowS # show :: UsageTable -> String # showList :: [UsageTable] -> ShowS # | |
Semigroup UsageTable Source # | |
Defined in Futhark.Analysis.UsageTable (<>) :: UsageTable -> UsageTable -> UsageTable # sconcat :: NonEmpty UsageTable -> UsageTable # stimes :: Integral b => b -> UsageTable -> UsageTable # | |
Monoid UsageTable Source # | |
Defined in Futhark.Analysis.UsageTable mempty :: UsageTable # mappend :: UsageTable -> UsageTable -> UsageTable # mconcat :: [UsageTable] -> UsageTable # |
without :: UsageTable -> [VName] -> UsageTable Source #
Remove these entries from the usage table.
used :: VName -> UsageTable -> Bool Source #
Is the variable present in the usage table? That is, has it been used?
expand :: (VName -> Names) -> UsageTable -> UsageTable Source #
Expand the usage table based on aliasing information.
isConsumed :: VName -> UsageTable -> Bool Source #
Has the variable been consumed?
isInResult :: VName -> UsageTable -> Bool Source #
Has the variable been used in the Result
of a body?
isUsedDirectly :: VName -> UsageTable -> Bool Source #
Has the given name been used directly (i.e. could we rename it or remove it without anyone noticing?)
isSize :: VName -> UsageTable -> Bool Source #
Is this name used as the size of something (array or memory block)?
usages :: Names -> UsageTable Source #
Construct a usage table reflecting that these variables have been used.
usage :: VName -> Usages -> UsageTable Source #
Construct a usage table where the given variable has been used in this specific way.
consumedUsage :: VName -> UsageTable Source #
Construct a usage table where the given variable has been consumed.
inResultUsage :: VName -> UsageTable Source #
Construct a usage table where the given variable has been used in
the Result
of a body.
sizeUsage :: VName -> UsageTable Source #
Construct a usage table where the given variable has been used as an array or memory size.
sizeUsages :: Names -> UsageTable Source #
Construct a usage table where the given names have been used as an array or memory size.
A description of how a single variable has been used.
usageInStm :: (ASTLore lore, Aliased lore) => Stm lore -> UsageTable Source #
Produce a usage table reflecting the use of the free variables in a single statement.