then do
-- patch the registers using the info in the graph
let code_patched = map (patchRegsFromGraph graph_colored) code
+
+ -- strip off liveness information
let code_nat = map stripLive code_patched
+
+ -- rewrite SPILL/REALOAD pseudos into real instructions
+ let spillNatTop = mapGenBlockTop spillNatBlock
+ let code_final = map spillNatTop code_nat
-- record what happened in this stage for debugging
let stat =
RegAllocStatsColored
{ raGraph = graph_colored
- , raPatchedCmm = code_patched }
+ , raPatchedCmm = code_patched
+ , raFinalCmm = code_final }
return ( code_nat
- , maybeToList stat1 ++ [stat] ++ debug_codeGraphs
+ , [stat] ++ maybeToList stat1 ++ debug_codeGraphs
, graph_colored)
else do
-- try again
regAlloc_spin (spinCount + 1) triv regsFree slotsFree'
- (maybeToList stat1 ++ [stat] ++ debug_codeGraphs)
+ ([stat] ++ maybeToList stat1 ++ debug_codeGraphs)
code_relive