-- record what happened in this stage for debugging
let stat =
RegAllocStatsColored
- { raGraph = graph
+ { raCode = code
+ , raGraph = graph
, raGraphColored = graph_colored_lint
, raCoalesced = rmCoalesce
, raCodeCoalesced = code_coalesced
-- record what happened in this stage for debugging
let stat =
RegAllocStatsSpill
- { raGraph = graph_colored_lint
+ { raCode = code
+ , raGraph = graph_colored_lint
, raCoalesced = rmCoalesce
, raSpillStats = spillStats
, raSpillCosts = spillCosts
import RegAlloc.Liveness
import RegAlloc.Graph.Spill
import RegAlloc.Graph.SpillCost
+import RegAlloc.Graph.TrivColorable
import Instruction
import RegClass
import Reg
+import TargetReg
import Cmm
import Outputable
-- a spill stage
| RegAllocStatsSpill
- { raGraph :: Color.Graph VirtualReg RegClass RealReg -- ^ the partially colored graph
+ { raCode :: [LiveCmmTop instr] -- ^ the code we tried to allocate registers for
+ , raGraph :: Color.Graph VirtualReg RegClass RealReg -- ^ the partially colored graph
, raCoalesced :: UniqFM VirtualReg -- ^ the regs that were coaleced
, raSpillStats :: SpillStats -- ^ spiller stats
, raSpillCosts :: SpillCostInfo -- ^ number of instrs each reg lives for
-- a successful coloring
| RegAllocStatsColored
- { raGraph :: Color.Graph VirtualReg RegClass RealReg -- ^ the uncolored graph
+ { raCode :: [LiveCmmTop instr] -- ^ the code we tried to allocate registers for
+ , raGraph :: Color.Graph VirtualReg RegClass RealReg -- ^ the uncolored graph
, raGraphColored :: Color.Graph VirtualReg RegClass RealReg -- ^ the coalesced and colored graph
, raCoalesced :: UniqFM VirtualReg -- ^ the regs that were coaleced
, raCodeCoalesced :: [LiveCmmTop instr] -- ^ code with coalescings applied
$$ text "# Native code with liveness information."
$$ ppr (raLiveCmm s)
$$ text ""
--- $$ text "# Initial register conflict graph."
--- $$ Color.dotGraph regDotColor trivColorable (raGraph s)
+ $$ text "# Initial register conflict graph."
+ $$ Color.dotGraph
+ targetRegDotColor
+ (trivColorable
+ targetVirtualRegSqueeze
+ targetRealRegSqueeze)
+ (raGraph s)
ppr (s@RegAllocStatsSpill{})
= text "# Spill"
+ $$ text "# Code with liveness information."
+ $$ (ppr (raCode s))
+ $$ text ""
+
-- $$ text "# Register conflict graph."
-- $$ Color.dotGraph regDotColor trivColorable (raGraph s)
-- $$ text ""
-- $$ Color.dotGraph regDotColor trivColorable (raGraph s)
-- $$ text ""
--- $$ text "# Register conflict graph (colored)."
--- $$ Color.dotGraph regDotColor trivColorable (raGraphColored s)
--- $$ text ""
+ $$ text "# Code with liveness information."
+ $$ (ppr (raCode s))
+ $$ text ""
+
+ $$ text "# Register conflict graph (colored)."
+ $$ Color.dotGraph
+ targetRegDotColor
+ (trivColorable
+ targetVirtualRegSqueeze
+ targetRealRegSqueeze)
+ (raGraphColored s)
+ $$ text ""
$$ (if (not $ isNullUFM $ raCoalesced s)
then text "# Registers coalesced."