ghc-8.10.1: The GHC API
Safe HaskellNone
LanguageHaskell2010

RegAlloc.Graph.SpillCost

Synopsis

Documentation

type SpillCostRecord = (VirtualReg, Int, Int, Int) #

Records the expected cost to spill some regster.

pprSpillCostRecord :: (VirtualReg -> RegClass) -> (Reg -> SDoc) -> Graph VirtualReg RegClass RealReg -> SpillCostRecord -> SDoc #

Show a spill cost record, including the degree from the graph and final calulated spill cost.

zeroSpillCostInfo :: SpillCostInfo #

An empty map of spill costs.

plusSpillCostInfo :: SpillCostInfo -> SpillCostInfo -> SpillCostInfo #

Add two spill cost infos.

slurpSpillCostInfo :: forall instr statics. (Outputable instr, Instruction instr) => Platform -> Maybe CFG -> LiveCmmDecl statics instr -> SpillCostInfo #

Slurp out information used for determining spill costs.

For each vreg, the number of times it was written to, read from, and the number of instructions it was live on entry to (lifetime)

chooseSpill :: SpillCostInfo -> Graph VirtualReg RegClass RealReg -> VirtualReg #

Choose a node to spill from this graph

lifeMapFromSpillCostInfo :: SpillCostInfo -> UniqFM (VirtualReg, Int) #

Extract a map of register lifetimes from a SpillCostInfo.