- -- write out the file
- let out = showSDoc
- ( text "-- (spills-added)"
- $$ text "-- Spill instructions inserted for each virtual reg."
- $$ text "-- (reg name, spill loads added, spill stores added)."
- $$ (vcat $ map pprSpillLS $ eltsUFM spillLS)
+
+ let outSpill = ( text "-- (spills-added)"
+ $$ text "-- Spill instructions inserted for each virtual reg."
+ $$ text "-- (reg_name, spill_loads_added, spill_stores_added)."
+ $$ (vcat $ map pprSpillLS $ eltsUFM spillLS)
+ $$ text "\n")
+
+ ---- Lifetimes
+ -- slurp out the maps of all the reg lifetimes
+ let lifetimes = map raLifetimes stats
+ let lifeMap = foldl' plusUFM emptyUFM $ map raLifetimes stats
+ let lifeBins = binLifetimeCount lifeMap
+
+ let outLife = ( text "-- (vreg-population-lifetimes)"
+ $$ text "-- Number of vregs which lived for a certain number of instructions"
+ $$ text "-- (instruction_count, number_of_vregs_that_lived_that_long)"
+ $$ (vcat $ map ppr $ eltsUFM lifeBins)