ghc-7.8.20140130: The GHC API

Safe HaskellNone
LanguageHaskell98

RegAlloc.Graph.Stats

Description

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

Synopsis

Documentation

data RegAllocStats statics instrSource

Holds interesting statistics from the register allocator.

Constructors

RegAllocStatsStart 

Fields

raLiveCmm :: [LiveCmmDecl statics instr]

Initial code, with liveness.

raGraph :: Graph VirtualReg RegClass RealReg

Uncolored graph.

Partially colored graph.

The initial, uncolored graph.

raSpillCosts :: SpillCostInfo

Number of instructions each reg lives for.

Information to help choose which regs to spill.

RegAllocStatsSpill 

Fields

raCode :: [LiveCmmDecl statics instr]

Code we tried to allocate registers for.

Code we tried to allocate registers for.

raGraph :: Graph VirtualReg RegClass RealReg

Uncolored graph.

Partially colored graph.

The initial, uncolored graph.

raCoalesced :: UniqFM VirtualReg

Regs that were coaleced.

The regs that were coaleced.

raSpillStats :: SpillStats

Spiller stats.

raSpillCosts :: SpillCostInfo

Number of instructions each reg lives for.

Information to help choose which regs to spill.

raSpilled :: [LiveCmmDecl statics instr]

Code with spill instructions added.

RegAllocStatsColored 

Fields

raCode :: [LiveCmmDecl statics instr]

Code we tried to allocate registers for.

Code we tried to allocate registers for.

raGraph :: Graph VirtualReg RegClass RealReg

Uncolored graph.

Partially colored graph.

The initial, uncolored graph.

raGraphColored :: Graph VirtualReg RegClass RealReg

Coalesced and colored graph.

raCoalesced :: UniqFM VirtualReg

Regs that were coaleced.

The regs that were coaleced.

raCodeCoalesced :: [LiveCmmDecl statics instr]

Code with coalescings applied.

raPatched :: [LiveCmmDecl statics instr]

Code with vregs replaced by hregs.

raSpillClean :: [LiveCmmDecl statics instr]

Code with unneeded spill/reloads cleaned out.

raFinal :: [NatCmmDecl statics instr]

Final code.

raSRMs :: (Int, Int, Int)

Spill/reload/reg-reg moves present in this code.

Instances

(Outputable statics, Outputable instr) => Outputable (RegAllocStats statics instr) 

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

Do all the different analysis on this list of RegAllocStats

pprStatsSpills :: [RegAllocStats statics instr] -> SDocSource

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

pprStatsLifetimes :: [RegAllocStats statics instr] -> SDocSource

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

pprStatsConflict :: [RegAllocStats statics instr] -> SDocSource

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

pprStatsLifeConflictSource

Arguments

:: [RegAllocStats statics 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 => LiveCmmDecl statics instr -> (Int, Int, Int)Source

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

addSRM :: (Int, Int, Int) -> (Int, Int, Int) -> (Int, Int, Int)Source