projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Trac #959: a long-standing bug in instantiating otherwise-unbound type variables
[ghc-hetmet.git]
/
compiler
/
nativeGen
/
RegAlloc
/
Linear
/
Stats.hs
diff --git
a/compiler/nativeGen/RegAlloc/Linear/Stats.hs
b/compiler/nativeGen/RegAlloc/Linear/Stats.hs
index
f20ad60
..
137168e
100644
(file)
--- a/
compiler/nativeGen/RegAlloc/Linear/Stats.hs
+++ b/
compiler/nativeGen/RegAlloc/Linear/Stats.hs
@@
-7,9
+7,9
@@
module RegAlloc.Linear.Stats (
where
import RegAlloc.Linear.Base
where
import RegAlloc.Linear.Base
-import RegLiveness
-import RegAllocInfo
-import MachInstrs
+import RegAlloc.Liveness
+import Instruction
+
import Cmm (GenBasicBlock(..))
import UniqFM
import Cmm (GenBasicBlock(..))
import UniqFM
@@
-35,7
+35,10
@@
binSpillReasons reasons
-- | Count reg-reg moves remaining in this code.
-- | Count reg-reg moves remaining in this code.
-countRegRegMovesNat :: NatCmmTop -> Int
+countRegRegMovesNat
+ :: Instruction instr
+ => NatCmmTop instr -> Int
+
countRegRegMovesNat cmm
= execState (mapGenBlockTopM countBlock cmm) 0
where
countRegRegMovesNat cmm
= execState (mapGenBlockTopM countBlock cmm) 0
where
@@
-44,7
+47,7
@@
countRegRegMovesNat cmm
return b
countInstr instr
return b
countInstr instr
- | Just _ <- isRegRegMove instr
+ | Just _ <- takeRegRegMoveInstr instr
= do modify (+ 1)
return instr
= do modify (+ 1)
return instr
@@
-53,7
+56,10
@@
countRegRegMovesNat cmm
-- | Pretty print some RegAllocStats
-- | Pretty print some RegAllocStats
-pprStats :: [NatCmmTop] -> [RegAllocStats] -> SDoc
+pprStats
+ :: Instruction instr
+ => [NatCmmTop instr] -> [RegAllocStats] -> SDoc
+
pprStats code statss
= let -- sum up all the instrs inserted by the spiller
spills = foldl' (plusUFM_C (zipWith (+)))
pprStats code statss
= let -- sum up all the instrs inserted by the spiller
spills = foldl' (plusUFM_C (zipWith (+)))