ghc-8.2.1: The GHC API

Safe HaskellNone
LanguageHaskell2010

RegAlloc.Linear.State

Description

State monad for the linear register allocator.

Synopsis

Documentation

data RA_State freeRegs Source #

The register allocator state

Constructors

RA_State 

Fields

data RegM freeRegs a Source #

The register allocator monad type.

Instances

Monad (RegM freeRegs) Source # 

Methods

(>>=) :: RegM freeRegs a -> (a -> RegM freeRegs b) -> RegM freeRegs b #

(>>) :: RegM freeRegs a -> RegM freeRegs b -> RegM freeRegs b #

return :: a -> RegM freeRegs a #

fail :: String -> RegM freeRegs a #

Functor (RegM freeRegs) Source # 

Methods

fmap :: (a -> b) -> RegM freeRegs a -> RegM freeRegs b #

(<$) :: a -> RegM freeRegs b -> RegM freeRegs a #

Applicative (RegM freeRegs) Source # 

Methods

pure :: a -> RegM freeRegs a #

(<*>) :: RegM freeRegs (a -> b) -> RegM freeRegs a -> RegM freeRegs b #

liftA2 :: (a -> b -> c) -> RegM freeRegs a -> RegM freeRegs b -> RegM freeRegs c #

(*>) :: RegM freeRegs a -> RegM freeRegs b -> RegM freeRegs b #

(<*) :: RegM freeRegs a -> RegM freeRegs b -> RegM freeRegs a #

HasDynFlags (RegM a) Source # 

runR :: DynFlags -> BlockAssignment freeRegs -> freeRegs -> RegMap Loc -> StackMap -> UniqSupply -> RegM freeRegs a -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a) Source #

Run a computation in the RegM register allocator monad.

spillR :: Instruction instr => Reg -> Unique -> RegM freeRegs (instr, Int) Source #

loadR :: Instruction instr => Reg -> Int -> RegM freeRegs instr Source #

getFreeRegsR :: RegM freeRegs freeRegs Source #

setFreeRegsR :: freeRegs -> RegM freeRegs () Source #

setAssigR :: RegMap Loc -> RegM freeRegs () Source #

getBlockAssigR :: RegM freeRegs (BlockAssignment freeRegs) Source #

setBlockAssigR :: BlockAssignment freeRegs -> RegM freeRegs () Source #

setDeltaR :: Int -> RegM freeRegs () Source #

getDeltaR :: RegM freeRegs Int Source #

recordSpill :: SpillReason -> RegM freeRegs () Source #

Record that a spill instruction was inserted, for profiling.