X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FRegAlloc%2FLinear%2FStats.hs;h=c80f77f8936d01de4e4dc0d22f1cd02c17f3f4c0;hb=HEAD;hp=f20ad607598274ed6145af4fffca1b6988ed66ca;hpb=cbc96da034482b769889c109f6cc822f42b12027;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegAlloc/Linear/Stats.hs b/compiler/nativeGen/RegAlloc/Linear/Stats.hs index f20ad60..c80f77f 100644 --- a/compiler/nativeGen/RegAlloc/Linear/Stats.hs +++ b/compiler/nativeGen/RegAlloc/Linear/Stats.hs @@ -7,10 +7,10 @@ module RegAlloc.Linear.Stats ( where import RegAlloc.Linear.Base -import RegLiveness -import RegAllocInfo -import MachInstrs -import Cmm (GenBasicBlock(..)) +import RegAlloc.Liveness +import Instruction + +import OldCmm (GenBasicBlock(..)) import UniqFM import Outputable @@ -35,7 +35,10 @@ binSpillReasons reasons -- | 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 @@ -44,7 +47,7 @@ countRegRegMovesNat cmm return b countInstr instr - | Just _ <- isRegRegMove instr + | Just _ <- takeRegRegMoveInstr instr = do modify (+ 1) return instr @@ -53,7 +56,10 @@ countRegRegMovesNat cmm -- | 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 (+)))