{-# OPTIONS -fno-warn-missing-signatures #-}
--- Carries interesting info for debugging / profiling of the
+-- | Carries interesting info for debugging / profiling of the
-- graph coloring register allocator.
---
-
module RegAlloc.Graph.Stats (
RegAllocStats (..),
import Reg
import TargetReg
-import Cmm
+import OldCmm
+import OldPprCmm()
import Outputable
import UniqFM
import UniqSet
$$ (ppr (raCode s))
$$ text ""
--- $$ text "# Register conflict graph."
--- $$ Color.dotGraph regDotColor trivColorable (raGraph s)
--- $$ text ""
-
$$ (if (not $ isNullUFM $ raCoalesced s)
then text "# Registers coalesced."
$$ (vcat $ map ppr $ ufmToList $ raCoalesced s)
$$ text ""
else empty)
--- $$ text "# Spill costs. reg uses defs lifetime degree cost"
--- $$ vcat (map (pprSpillCostRecord (raGraph s)) $ eltsUFM $ raSpillCosts s)
--- $$ text ""
-
$$ text "# Spills inserted."
$$ ppr (raSpillStats s)
$$ text ""
ppr (s@RegAllocStatsColored { raSRMs = (spills, reloads, moves) })
= text "# Colored"
--- $$ text "# Register conflict graph (initial)."
--- $$ Color.dotGraph regDotColor trivColorable (raGraph s)
--- $$ text ""
-
$$ text "# Code with liveness information."
$$ (ppr (raCode s))
$$ text ""
-- | Count spill/reload/reg-reg moves.
-- Lets us see how well the register allocator has done.
---
countSRMs
:: Instruction instr
=> LiveCmmTop instr -> (Int, Int, Int)
addSRM (s1, r1, m1) (s2, r2, m2)
= (s1+s2, r1+r2, m1+m2)
-
-
-
-
-
-{-
-toX11Color (r, g, b)
- = let rs = padL 2 '0' (showHex r "")
- gs = padL 2 '0' (showHex r "")
- bs = padL 2 '0' (showHex r "")
-
- padL n c s
- = replicate (n - length s) c ++ s
- in "#" ++ rs ++ gs ++ bs
--}