X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmCPSZ.hs;h=4dff9bc1d472a609a04a9901106419aa9b23626f;hb=684fde094dc5b064b49dbef191ca07cb9a018e45;hp=d0858e977ab96633822457aff24929f07adcb284;hpb=1241c26f3552a2037263769e5ef7fa68d9f3be36;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmCPSZ.hs b/compiler/cmm/CmmCPSZ.hs index d0858e9..4dff9bc 100644 --- a/compiler/cmm/CmmCPSZ.hs +++ b/compiler/cmm/CmmCPSZ.hs @@ -43,8 +43,12 @@ cpsTop (CmmProc h l args g) = let procPoints = minimalProcPointSet (runTx cmmCfgOptsZ g) g' = addProcPointProtocols procPoints args g g'' = map_nodes id NotSpillOrReload id g' - in do us <- getUs - let g = runDFM us dualLiveLattice $ b_rewrite dualLivenessWithInsertion g'' - -- let igraph = buildIGraph - return $ do g' <- g >>= return . map_nodes id spillAndReloadComments id - return $ CmmProc h l args g' + in do g <- dual_rewrite dualLivenessWithInsertion g'' + g <- return (g >>= insertLateReloads) + u <- getUs + let g' = g >>= (initUs_ u . dual_rewrite removeDeadAssignmentsAndReloads) + return $ do g <- g' >>= return . map_nodes id spillAndReloadComments id + return $ CmmProc h l args g + where dual_rewrite pass g = + do us <- getUs + return $ runDFM us dualLiveLattice $ b_rewrite pass g