ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Core.Opt.Simplify.Monad

Synopsis

- data TopEnvConfig = TopEnvConfig {
  - te_history_size :: !Int
  - te_tick_factor :: !Int
  }
- data SimplM result
- initSmpl :: Logger -> IO RuleEnv -> TopEnvConfig -> Int -> SimplM a -> IO (a, SimplCount)
- traceSmpl :: String -> SDoc -> SimplM ()
- getSimplRules :: SimplM RuleEnv
- class Monad m => MonadUnique m where
  - getUniqueSupplyM :: m UniqSupply
  - getUniqueM :: m Unique
  - getUniquesM :: m [Unique]
- newId :: FastString -> Mult -> Type -> SimplM Id
- newJoinId :: [Var] -> Type -> SimplM Id
- data SimplCount
- tick :: Tick -> SimplM ()
- freeTick :: Tick -> SimplM ()
- checkedTick :: Tick -> SimplM ()
- getSimplCount :: SimplM SimplCount
- zeroSimplCount :: Bool -> SimplCount
- pprSimplCount :: SimplCount -> SDoc
- plusSimplCount :: SimplCount -> SimplCount -> SimplCount
- isZeroSimplCount :: SimplCount -> Bool

# Documentation

data TopEnvConfig Source #

Constructors

TopEnvConfig |

Fields

- te_history_size :: !Int
- te_tick_factor :: !Int

data SimplM result Source #

#### Instances

Instances details

MonadIO SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods liftIO :: IO a -> SimplM a Source #
Applicative SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods pure :: a -> SimplM a Source # (<*>) :: SimplM (a -> b) -> SimplM a -> SimplM b Source # liftA2 :: (a -> b -> c) -> SimplM a -> SimplM b -> SimplM c Source # (*>) :: SimplM a -> SimplM b -> SimplM b Source # (<*) :: SimplM a -> SimplM b -> SimplM a Source #
Functor SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods fmap :: (a -> b) -> SimplM a -> SimplM b Source # (<$) :: a -> SimplM b -> SimplM a Source #
Monad SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods (>>=) :: SimplM a -> (a -> SimplM b) -> SimplM b Source # (>>) :: SimplM a -> SimplM b -> SimplM b Source # return :: a -> SimplM a Source #
MonadUnique SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods getUniqueSupplyM :: SimplM UniqSupply Source # getUniqueM :: SimplM Unique Source # getUniquesM :: SimplM [Unique] Source #
HasLogger SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods getLogger :: SimplM Logger Source #

initSmpl Source #

Arguments

:: Logger |
-> IO RuleEnv |
-> TopEnvConfig |
-> Int | Size of the bindings, used to limit the number of ticks we allow
-> SimplM a |
-> IO (a, SimplCount) |

traceSmpl :: String -> SDoc -> SimplM () Source #

getSimplRules :: SimplM RuleEnv Source #

class Monad m => MonadUnique m where Source #

A monad for generating unique identifiers

Minimal complete definition

getUniqueSupplyM

Methods

getUniqueSupplyM :: m UniqSupply Source #

Get a new UniqueSupply

getUniqueM :: m Unique Source #

Get a new unique identifier

getUniquesM :: m [Unique] Source #

Get an infinite list of new unique identifiers

#### Instances

Instances details

MonadUnique NatM Source # |
Instance details Defined in GHC.CmmToAsm.Monad Methods getUniqueSupplyM :: NatM UniqSupply Source # getUniqueM :: NatM Unique Source # getUniquesM :: NatM [Unique] Source #
MonadUnique LlvmM Source # |
Instance details Defined in GHC.CmmToLlvm.Base Methods getUniqueSupplyM :: LlvmM UniqSupply Source # getUniqueM :: LlvmM Unique Source # getUniquesM :: LlvmM [Unique] Source #
MonadUnique CoreM Source # |
Instance details Defined in GHC.Core.Opt.Monad Methods getUniqueSupplyM :: CoreM UniqSupply Source # getUniqueM :: CoreM Unique Source # getUniquesM :: CoreM [Unique] Source #
MonadUnique SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods getUniqueSupplyM :: SimplM UniqSupply Source # getUniqueM :: SimplM Unique Source # getUniquesM :: SimplM [Unique] Source #
MonadUnique NullCollapseViz Source # |
Instance details Defined in GHC.Data.Graph.Collapse Methods getUniqueSupplyM :: NullCollapseViz UniqSupply Source # getUniqueM :: NullCollapseViz Unique Source # getUniquesM :: NullCollapseViz [Unique] Source #
MonadUnique LiftM Source # |
Instance details Defined in GHC.Stg.Lift.Monad Methods getUniqueSupplyM :: LiftM UniqSupply Source # getUniqueM :: LiftM Unique Source # getUniquesM :: LiftM [Unique] Source #
MonadUnique CmmParse Source # |
Instance details Defined in GHC.StgToCmm.ExtCode Methods getUniqueSupplyM :: CmmParse UniqSupply Source # getUniqueM :: CmmParse Unique Source # getUniquesM :: CmmParse [Unique] Source #
MonadUnique FCode Source # |
Instance details Defined in GHC.StgToCmm.Monad Methods getUniqueSupplyM :: FCode UniqSupply Source # getUniqueM :: FCode Unique Source # getUniquesM :: FCode [Unique] Source #
MonadUnique TcS Source # |
Instance details Defined in GHC.Tc.Solver.Monad Methods getUniqueSupplyM :: TcS UniqSupply Source # getUniqueM :: TcS Unique Source # getUniquesM :: TcS [Unique] Source #
MonadUnique UniqSM Source # |
Instance details Defined in GHC.Types.Unique.Supply Methods getUniqueSupplyM :: UniqSM UniqSupply Source # getUniqueM :: UniqSM Unique Source # getUniquesM :: UniqSM [Unique] Source #
MonadUnique (IOEnv (Env gbl lcl)) Source # |
Instance details Defined in GHC.Tc.Utils.Monad Methods getUniqueSupplyM :: IOEnv (Env gbl lcl) UniqSupply Source # getUniqueM :: IOEnv (Env gbl lcl) Unique Source # getUniquesM :: IOEnv (Env gbl lcl) [Unique] Source #

newId :: FastString -> Mult -> Type -> SimplM Id Source #

newJoinId :: [Var] -> Type -> SimplM Id Source #

Make a join id with given type and arity but without call-by-value annotations.

data SimplCount Source #

tick :: Tick -> SimplM () Source #

freeTick :: Tick -> SimplM () Source #

checkedTick :: Tick -> SimplM () Source #

getSimplCount :: SimplM SimplCount Source #

zeroSimplCount Source #

Arguments

:: Bool

- ddump-simpl-stats

-> SimplCount |

pprSimplCount :: SimplCount -> SDoc Source #

plusSimplCount :: SimplCount -> SimplCount -> SimplCount Source #

isZeroSimplCount :: SimplCount -> Bool Source #