NCG: Also show the result of applying coalesings with -ddump-asm-regalloc-stages
authorBen.Lippmeier.anu.edu.au <unknown>
Thu, 17 Sep 2009 03:44:27 +0000 (03:44 +0000)
committerBen.Lippmeier.anu.edu.au <unknown>
Thu, 17 Sep 2009 03:44:27 +0000 (03:44 +0000)
compiler/nativeGen/RegAlloc/Graph/Main.hs
compiler/nativeGen/RegAlloc/Graph/Stats.hs

index 35ec879..40c3c00 100644 (file)
@@ -178,6 +178,7 @@ regAlloc_spin
                        { raGraph               = graph
                        , raGraphColored        = graph_colored_lint
                        , raCoalesced           = rmCoalesce
+                       , raCodeCoalesced       = code_coalesced
                        , raPatched             = code_patched
                        , raSpillClean          = code_spillclean
                        , raFinal               = code_final
index 10ab0cb..339bd41 100644 (file)
@@ -53,13 +53,14 @@ data RegAllocStats instr
 
        -- a successful coloring
        | RegAllocStatsColored
-       { 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
-       , raPatched     :: [LiveCmmTop instr]                           -- ^ code with vregs replaced by hregs
-       , raSpillClean  :: [LiveCmmTop instr]                           -- ^ code with unneeded spill\/reloads cleaned out
-       , raFinal       :: [NatCmmTop instr]                            -- ^ final code
-       , raSRMs        :: (Int, Int, Int) }                            -- ^ spill\/reload\/reg-reg moves present in this code
+       { 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 
+       , raPatched       :: [LiveCmmTop instr]                         -- ^ code with vregs replaced by hregs
+       , raSpillClean    :: [LiveCmmTop instr]                         -- ^ code with unneeded spill\/reloads cleaned out
+       , raFinal         :: [NatCmmTop instr]                          -- ^ final code
+       , raSRMs          :: (Int, Int, Int) }                          -- ^ spill\/reload\/reg-reg moves present in this code
 
 instance Outputable instr => Outputable (RegAllocStats instr) where
 
@@ -114,6 +115,10 @@ instance Outputable instr => Outputable (RegAllocStats instr) where
                        $$ text ""
                else empty)
 
+       $$ text "#  Native code after coalescings applied."
+       $$ ppr (raCodeCoalesced s)
+       $$ text ""
+
        $$ text "#  Native code after register allocation."
        $$ ppr (raPatched s)
        $$ text ""