Safe Haskell | None |
---|---|
Language | GHC2021 |
State monad for the linear register allocator.
Synopsis
- data RA_State freeRegs = RA_State {
- ra_blockassig :: BlockAssignment freeRegs
- ra_freeregs :: !freeRegs
- ra_assig :: RegMap Loc
- ra_delta :: Int
- ra_stack :: StackMap
- ra_us :: UniqSupply
- ra_spills :: [SpillReason]
- ra_config :: !NCGConfig
- ra_fixups :: [(BlockId, BlockId, BlockId)]
- data RegM freeRegs a
- runR :: NCGConfig -> BlockAssignment freeRegs -> freeRegs -> RegMap Loc -> StackMap -> UniqSupply -> RegM freeRegs a -> (BlockAssignment freeRegs, StackMap, RegAllocStats, a)
- spillR :: Instruction instr => Reg -> Unique -> RegM freeRegs ([instr], Int)
- loadR :: Instruction instr => Reg -> Int -> RegM freeRegs [instr]
- getFreeRegsR :: RegM freeRegs freeRegs
- setFreeRegsR :: freeRegs -> RegM freeRegs ()
- getAssigR :: RegM freeRegs (RegMap Loc)
- setAssigR :: RegMap Loc -> RegM freeRegs ()
- getBlockAssigR :: RegM freeRegs (BlockAssignment freeRegs)
- setBlockAssigR :: BlockAssignment freeRegs -> RegM freeRegs ()
- setDeltaR :: Int -> RegM freeRegs ()
- getDeltaR :: RegM freeRegs Int
- getUniqueR :: RegM freeRegs Unique
- getConfig :: RegM a NCGConfig
- getPlatform :: RegM a Platform
- recordSpill :: SpillReason -> RegM freeRegs ()
- recordFixupBlock :: BlockId -> BlockId -> BlockId -> RegM freeRegs ()
Documentation
data RA_State freeRegs Source #
The register allocator state
RA_State | |
|
The register allocator monad type.
Instances
Applicative (RegM freeRegs) Source # | |
Defined in GHC.CmmToAsm.Reg.Linear.State 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 # | |
Functor (RegM freeRegs) Source # | |
Monad (RegM freeRegs) Source # | |
runR :: NCGConfig -> 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.
getFreeRegsR :: RegM freeRegs freeRegs Source #
setFreeRegsR :: freeRegs -> RegM freeRegs () Source #
getBlockAssigR :: RegM freeRegs (BlockAssignment freeRegs) Source #
setBlockAssigR :: BlockAssignment freeRegs -> RegM freeRegs () Source #
getUniqueR :: RegM freeRegs Unique Source #
getPlatform :: RegM a Platform Source #
Get target platform from native code generator configuration
recordSpill :: SpillReason -> RegM freeRegs () Source #
Record that a spill instruction was inserted, for profiling.