projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
06f647d
)
NCG: Reverse SCCs after each round in the graph allocator
author
benl@ouroborus.net
<unknown>
Thu, 24 Jun 2010 08:24:37 +0000
(08:24 +0000)
committer
benl@ouroborus.net
<unknown>
Thu, 24 Jun 2010 08:24:37 +0000
(08:24 +0000)
compiler/nativeGen/RegAlloc/Liveness.hs
patch
|
blob
|
history
diff --git
a/compiler/nativeGen/RegAlloc/Liveness.hs
b/compiler/nativeGen/RegAlloc/Liveness.hs
index
61e800f
..
cc1bf12
100644
(file)
--- a/
compiler/nativeGen/RegAlloc/Liveness.hs
+++ b/
compiler/nativeGen/RegAlloc/Liveness.hs
@@
-27,6
+27,7
@@
module RegAlloc.Liveness (
eraseDeltasLive,
patchEraseLive,
patchRegsLiveInstr,
eraseDeltasLive,
patchEraseLive,
patchRegsLiveInstr,
+ reverseBlocksInTops,
regLiveness,
natCmmTopToLive
) where
regLiveness,
natCmmTopToLive
) where
@@
-670,9
+671,6
@@
regLiveness (CmmProc info lbl params sccs)
lbl params ann_sccs
lbl params ann_sccs
-
-
-
-- -----------------------------------------------------------------------------
-- | Check ordering of Blocks
-- The computeLiveness function requires SCCs to be in reverse dependent order.
-- -----------------------------------------------------------------------------
-- | Check ordering of Blocks
-- The computeLiveness function requires SCCs to be in reverse dependent order.
@@
-711,8
+709,17
@@
checkIsReverseDependent sccs'
= unionManyUniqSets
$ map (mkUniqSet . jumpDestsOfInstr)
[ i | LiveInstr i _ <- instrs]
= unionManyUniqSets
$ map (mkUniqSet . jumpDestsOfInstr)
[ i | LiveInstr i _ <- instrs]
-
+
+-- | If we've compute liveness info for this code already we have to reverse
+-- the SCCs in each top to get them back to the right order so we can do it again.
+reverseBlocksInTops :: LiveCmmTop instr -> LiveCmmTop instr
+reverseBlocksInTops top
+ = case top of
+ CmmData{} -> top
+ CmmProc info lbl params sccs -> CmmProc info lbl params (reverse sccs)
+
+
-- | Computing liveness
--
-- On entry, the SCCs must be in "reverse" order: later blocks may transfer
-- | Computing liveness
--
-- On entry, the SCCs must be in "reverse" order: later blocks may transfer