Generalized assignment rewriting pass.
[ghc-hetmet.git] / compiler / cmm / CmmCPS.hs
index aad0037..e2bbbdd 100644 (file)
@@ -1,6 +1,7 @@
 {-# OPTIONS_GHC -XNoMonoLocalBinds #-}
 -- Norman likes local bindings
 -- If this module lives on I'd like to get rid of this flag in due course
+
 module CmmCPS (
   -- | Converts C-- with full proceedures and parameters
   -- to a CPS transformed C-- with the stack made manifest.
@@ -95,9 +96,8 @@ cpsTop hsc_env (CmmProc h@(TopInfo {stack_info=StackInfo {arg_space=entry_off}})
                              (dualLivenessWithInsertion procPoints) g
                     -- Insert spills at defns; reloads at return points
        g     <-
-              -- pprTrace "pre insertLateReloads" (ppr g) $
-                runOptimization $ insertLateReloads g -- Duplicate reloads just before uses
-       dump Opt_D_dump_cmmz "Post late reloads" g
+                runOptimization $ rewriteAssignments g
+       dump Opt_D_dump_cmmz "Post rewrite assignments" g
        g     <-
                -- pprTrace "post insertLateReloads" (ppr g) $
                 dual_rewrite runOptimization Opt_D_dump_cmmz "Dead Assignment Elimination"