projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Document ZipCfg
[ghc-hetmet.git]
/
compiler
/
cmm
/
ZipCfg.hs
diff --git
a/compiler/cmm/ZipCfg.hs
b/compiler/cmm/ZipCfg.hs
index
c7aa1ff
..
78eeaed
100644
(file)
--- a/
compiler/cmm/ZipCfg.hs
+++ b/
compiler/cmm/ZipCfg.hs
@@
-36,8
+36,9
@@
where
#include "HsVersions.h"
#include "HsVersions.h"
+import BlockId ( BlockId, BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv
+ , BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet)
import CmmExpr ( UserOfLocalRegs(..) ) --for an instance
import CmmExpr ( UserOfLocalRegs(..) ) --for an instance
-import StackSlot
import Outputable hiding (empty)
import Panic
import Outputable hiding (empty)
import Panic
@@
-378,7
+379,7
@@
lastTail :: ZTail m l -> ZLast l
lastTail (ZLast l) = l
lastTail (ZTail _ t) = lastTail t
lastTail (ZLast l) = l
lastTail (ZTail _ t) = lastTail t
-tailOfLast l = ZLast (LastOther l) -- ^ tedious to write in every client
+tailOfLast l = ZLast (LastOther l) -- tedious to write in every client
------------------ simple graph manipulations
------------------ simple graph manipulations
@@
-404,7
+405,7
@@
splitp_blocks p blocks = lift $ foldUFM scan (Nothing, emptyBlockEnv) blocks
lift (Nothing, _) = Nothing
lift (Just b, bs) = Just (b, bs)
lift (Nothing, _) = Nothing
lift (Just b, bs) = Just (b, bs)
--- | 'insertBlock' should not be used to *replace* an existing block
+-- | 'insertBlock' should not be used to /replace/ an existing block
-- but only to insert a new one
insertBlock :: Block m l -> BlockEnv (Block m l) -> BlockEnv (Block m l)
insertBlock b bs =
-- but only to insert a new one
insertBlock :: Block m l -> BlockEnv (Block m l) -> BlockEnv (Block m l)
insertBlock b bs =
@@
-442,9
+443,11
@@
single_exitg (Graph tail blocks) = foldUFM add (exit_count (lastTail tail)) bloc
-- more mathematically elegant (but results in more complicated code).
--
-- Here's an easy way to go wrong! Consider
-- more mathematically elegant (but results in more complicated code).
--
-- Here's an easy way to go wrong! Consider
+-- @
-- A -> [B,C]
-- B -> D
-- C -> D
-- A -> [B,C]
-- B -> D
-- C -> D
+-- @
-- Then ordinary dfs would give [A,B,D,C] which has a back ref from C to D.
-- Better to geot [A,B,C,D]
-- Then ordinary dfs would give [A,B,D,C] which has a back ref from C to D.
-- Better to geot [A,B,C,D]