State monad for the linear register allocator.
- data RA_State = RA_State {
- ra_blockassig :: BlockAssignment
- ra_freeregs :: !FreeRegs
- ra_assig :: RegMap Loc
- ra_delta :: Int
- ra_stack :: StackMap
- ra_us :: UniqSupply
- ra_spills :: [SpillReason]
- data RegM a
- runR :: BlockAssignment -> FreeRegs -> RegMap Loc -> StackMap -> UniqSupply -> RegM a -> (BlockAssignment, StackMap, RegAllocStats, a)
- spillR :: Instruction instr => Reg -> Unique -> RegM (instr, Int)
- loadR :: Instruction instr => Reg -> Int -> RegM instr
- getFreeRegsR :: RegM FreeRegs
- setFreeRegsR :: FreeRegs -> RegM ()
- getAssigR :: RegM (RegMap Loc)
- setAssigR :: RegMap Loc -> RegM ()
- getBlockAssigR :: RegM BlockAssignment
- setBlockAssigR :: BlockAssignment -> RegM ()
- setDeltaR :: Int -> RegM ()
- getDeltaR :: RegM Int
- getUniqueR :: RegM Unique
- recordSpill :: SpillReason -> RegM ()
Documentation
The register alloctor state
RA_State | |
|
runR :: BlockAssignment -> FreeRegs -> RegMap Loc -> StackMap -> UniqSupply -> RegM a -> (BlockAssignment, StackMap, RegAllocStats, a)Source
Run a computation in the RegM register allocator monad.
setFreeRegsR :: FreeRegs -> RegM ()Source
setBlockAssigR :: BlockAssignment -> RegM ()Source
recordSpill :: SpillReason -> RegM ()Source
Record that a spill instruction was inserted, for profiling.