{-# LANGUAGE TemplateHaskell #-}
module Clash.Normalize.Types where
import Control.Monad.State.Strict (State)
import Data.Map (Map)
import Data.Set (Set)
import Data.Text (Text)
import Clash.Core.Term (Term)
import Clash.Core.Type (Type)
import Clash.Core.Var (Id)
import Clash.Core.VarEnv (VarEnv)
import Clash.Driver.Types (BindingMap)
import Clash.Primitives.Types (CompiledPrimMap)
import Clash.Rewrite.Types (Rewrite, RewriteMonad)
import Clash.Util
data NormalizeState
= NormalizeState
{ NormalizeState -> BindingMap
_normalized :: BindingMap
, NormalizeState -> Map (Id, Int, Either Term Type) Id
_specialisationCache :: Map (Id,Int,Either Term Type) Id
, NormalizeState -> VarEnv Int
_specialisationHistory :: VarEnv Int
, NormalizeState -> Int
_specialisationLimit :: !Int
, NormalizeState -> VarEnv (VarEnv Int)
_inlineHistory :: VarEnv (VarEnv Int)
, NormalizeState -> Int
_inlineLimit :: !Int
, NormalizeState -> Word
_inlineFunctionLimit :: !Word
, NormalizeState -> Word
_inlineConstantLimit :: !Word
, NormalizeState -> CompiledPrimMap
_primitives :: CompiledPrimMap
, NormalizeState -> Map Text (Set Int)
_primitiveArgs :: Map Text (Set Int)
, NormalizeState -> VarEnv Bool
_recursiveComponents :: VarEnv Bool
, NormalizeState -> Bool
_newInlineStrategy :: Bool
, NormalizeState -> Bool
_normalizeUltra :: Bool
, NormalizeState -> Word
_inlineWFCacheLimit :: !Word
}
makeLenses ''NormalizeState
type NormalizeMonad = State NormalizeState
type NormalizeSession = RewriteMonad NormalizeState
type NormRewrite = Rewrite NormalizeState
data TermClassification
= TermClassification
{ TermClassification -> Int
_function :: !Int
, TermClassification -> Int
_primitive :: !Int
, TermClassification -> Int
_selection :: !Int
}
deriving Int -> TermClassification -> ShowS
[TermClassification] -> ShowS
TermClassification -> String
(Int -> TermClassification -> ShowS)
-> (TermClassification -> String)
-> ([TermClassification] -> ShowS)
-> Show TermClassification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TermClassification] -> ShowS
$cshowList :: [TermClassification] -> ShowS
show :: TermClassification -> String
$cshow :: TermClassification -> String
showsPrec :: Int -> TermClassification -> ShowS
$cshowsPrec :: Int -> TermClassification -> ShowS
Show
makeLenses ''TermClassification