projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge ghc-new-co into master branch
[ghc-hetmet.git]
/
compiler
/
cmm
/
CmmCPS.hs
diff --git
a/compiler/cmm/CmmCPS.hs
b/compiler/cmm/CmmCPS.hs
index
6e0cd33
..
6e97100
100644
(file)
--- a/
compiler/cmm/CmmCPS.hs
+++ b/
compiler/cmm/CmmCPS.hs
@@
-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
{-# 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.
module CmmCPS (
-- | Converts C-- with full proceedures and parameters
-- to a CPS transformed C-- with the stack made manifest.
@@
-95,8
+96,9
@@
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 <-
(dualLivenessWithInsertion procPoints) g
-- Insert spills at defns; reloads at return points
g <-
- runOptimization $ rewriteAssignments g
- dump Opt_D_dump_cmmz "Post rewrite assignments" g
+ -- pprTrace "pre insertLateReloads" (ppr g) $
+ runOptimization $ insertLateReloads g -- Duplicate reloads just before uses
+ dump Opt_D_dump_cmmz "Post late reloads" g
g <-
-- pprTrace "post insertLateReloads" (ppr g) $
dual_rewrite runOptimization Opt_D_dump_cmmz "Dead Assignment Elimination"
g <-
-- pprTrace "post insertLateReloads" (ppr g) $
dual_rewrite runOptimization Opt_D_dump_cmmz "Dead Assignment Elimination"
@@
-111,12
+113,13
@@
cpsTop hsc_env (CmmProc h@(TopInfo {stack_info=StackInfo {arg_space=entry_off}})
--------------- Stack layout ----------------
slotEnv <- run $ liveSlotAnal g
--------------- Stack layout ----------------
slotEnv <- run $ liveSlotAnal g
+ let spEntryMap = getSpEntryMap entry_off g
mbpprTrace "live slot analysis results: " (ppr slotEnv) $ return ()
mbpprTrace "live slot analysis results: " (ppr slotEnv) $ return ()
- let areaMap = layout procPoints slotEnv entry_off g
+ let areaMap = layout procPoints spEntryMap slotEnv entry_off g
mbpprTrace "areaMap" (ppr areaMap) $ return ()
------------ Manifest the stack pointer --------
mbpprTrace "areaMap" (ppr areaMap) $ return ()
------------ Manifest the stack pointer --------
- g <- run $ manifestSP areaMap entry_off g
+ g <- run $ manifestSP spEntryMap areaMap entry_off g
dump Opt_D_dump_cmmz "after manifestSP" g
-- UGH... manifestSP can require updates to the procPointMap.
-- We can probably do something quicker here for the update...
dump Opt_D_dump_cmmz "after manifestSP" g
-- UGH... manifestSP can require updates to the procPointMap.
-- We can probably do something quicker here for the update...