| Copyright | (C) 2012-2016 University of Twente 2016 Myrtle Software Ltd 2017 Google Inc. |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Clash.Normalize
Description
Turn CoreHW terms into normalized CoreHW Terms
Synopsis
- runNormalization :: ClashOpts -> Supply -> BindingMap -> (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType))) -> CustomReprs -> TyConMap -> IntMap TyConName -> PrimEvaluator -> CompiledPrimMap -> VarEnv Bool -> [Id] -> NormalizeSession a -> a
- normalize :: [Id] -> NormalizeSession BindingMap
- normalize' :: Id -> NormalizeSession ([Id], (Id, (Id, SrcSpan, InlineSpec, Term)))
- checkNonRecursive :: BindingMap -> BindingMap
- cleanupGraph :: Id -> BindingMap -> NormalizeSession BindingMap
- data CallTree
- mkCallTree :: [Id] -> BindingMap -> Id -> Maybe CallTree
- stripArgs :: [Id] -> [Id] -> [Either Term Type] -> Maybe [Either Term Type]
- flattenNode :: CallTree -> NormalizeSession (Either CallTree ((Id, Term), [CallTree]))
- flattenCallTree :: CallTree -> NormalizeSession CallTree
- callTreeToList :: [Id] -> CallTree -> ([Id], [(Id, (Id, SrcSpan, InlineSpec, Term))])
Documentation
Arguments
| :: ClashOpts | Level of debug messages to print |
| -> Supply | UniqueSupply |
| -> BindingMap | Global Binders |
| -> (CustomReprs -> TyConMap -> Type -> State HWMap (Maybe (Either String FilteredHWType))) | Hardcoded Type -> HWType translator |
| -> CustomReprs | |
| -> TyConMap | TyCon cache |
| -> IntMap TyConName | Tuple TyCon cache |
| -> PrimEvaluator | Hardcoded evaluator (delta-reduction) |
| -> CompiledPrimMap | Primitive Definitions |
| -> VarEnv Bool | Map telling whether a components is part of a recursive group |
| -> [Id] | topEntities |
| -> NormalizeSession a | NormalizeSession to run |
| -> a |
Run a NormalizeSession in a given environment
normalize :: [Id] -> NormalizeSession BindingMap Source #
normalize' :: Id -> NormalizeSession ([Id], (Id, (Id, SrcSpan, InlineSpec, Term))) Source #
Arguments
| :: BindingMap | List of normalized binders |
| -> BindingMap |
Check whether the normalized bindings are non-recursive. Errors when one of the components is recursive.
cleanupGraph :: Id -> BindingMap -> NormalizeSession BindingMap Source #
Perform general "clean up" of the normalized (non-recursive) function hierarchy. This includes:
- Inlining functions that simply "wrap" another function
Arguments
| :: [Id] | Visited |
| -> BindingMap | Global binders |
| -> Id | Root of the call graph |
| -> Maybe CallTree |
flattenNode :: CallTree -> NormalizeSession (Either CallTree ((Id, Term), [CallTree])) Source #