where
import RegAlloc.Linear.Base
-import RegLiveness
-import RegAllocInfo
-import Instrs
+import RegAlloc.Liveness
+import Instruction
+
import Cmm (GenBasicBlock(..))
import UniqFM
-- | 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
return b
countInstr instr
- | Just _ <- isRegRegMove instr
+ | Just _ <- takeRegRegMoveInstr instr
= do modify (+ 1)
return instr
-- | 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 (+)))