ghc-7.0.1: The GHC API

RegAlloc.Graph.Stats

Description

Carries interesting info for debugging / profiling of the graph coloring register allocator.

Synopsis

Documentation

data RegAllocStats instr Source

Constructors

RegAllocStatsStart

information to help choose which regs to spill

Fields

raLiveCmm :: [LiveCmmTop instr]

initial code, with liveness

raGraph :: Graph VirtualReg RegClass RealReg

the initial, uncolored graph

raSpillCosts :: SpillCostInfo
 
RegAllocStatsSpill

code with spill instructions added

Fields

raCode :: [LiveCmmTop instr]

the code we tried to allocate registers for

raGraph :: Graph VirtualReg RegClass RealReg

the initial, uncolored graph

raCoalesced :: UniqFM VirtualReg

the regs that were coaleced

raSpillStats :: SpillStats

spiller stats

raSpillCosts :: SpillCostInfo
 
raSpilled :: [LiveCmmTop instr]
 
RegAllocStatsColored

spill/reload/reg-reg moves present in this code

Fields

raCode :: [LiveCmmTop instr]

the code we tried to allocate registers for

raGraph :: Graph VirtualReg RegClass RealReg

the initial, uncolored graph

raGraphColored :: Graph VirtualReg RegClass RealReg

the coalesced and colored graph

raCoalesced :: UniqFM VirtualReg

the regs that were coaleced

raCodeCoalesced :: [LiveCmmTop instr]

code with coalescings applied

raPatched :: [LiveCmmTop instr]

code with vregs replaced by hregs

raSpillClean :: [LiveCmmTop instr]

code with unneeded spill/reloads cleaned out

raFinal :: [NatCmmTop instr]

final code

raSRMs :: (Int, Int, Int)
 

Instances

pprStats :: [RegAllocStats instr] -> Graph VirtualReg RegClass RealReg -> SDocSource

Do all the different analysis on this list of RegAllocStats

pprStatsSpills :: [RegAllocStats instr] -> SDocSource

Dump a table of how many spill loads / stores were inserted for each vreg.

pprStatsLifetimes :: [RegAllocStats instr] -> SDocSource

Dump a table of how long vregs tend to live for in the initial code.

pprStatsConflict :: [RegAllocStats instr] -> SDocSource

Dump a table of how many conflicts vregs tend to have in the initial code.

pprStatsLifeConflictSource

Arguments

:: [RegAllocStats instr] 
-> Graph VirtualReg RegClass RealReg

global register conflict graph

-> SDoc 

For every vreg, dump it's how many conflicts it has and its lifetime good for making a scatter plot.

countSRMs :: Instruction instr => LiveCmmTop instr -> (Int, Int, Int)Source

Count spillreloadreg-reg moves. Lets us see how well the register allocator has done.

addSRM :: (Num a2, Num a, Num a1) => (a, a1, a2) -> (a, a1, a2) -> (a, a1, a2)Source