ghc-7.10.0.20150316: The GHC API

Safe HaskellNone
LanguageHaskell2010

RegAlloc.Graph.SpillCost

Synopsis

Documentation

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

Records the expected cost to spill some regster.

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

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

zeroSpillCostInfo :: SpillCostInfo Source

An empty map of spill costs.

slurpSpillCostInfo :: (Outputable instr, Instruction instr) => Platform -> LiveCmmDecl statics instr -> SpillCostInfo Source

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 Source

Choose a node to spill from this graph

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

Extract a map of register lifetimes from a SpillCostInfo.