warning police
[ghc-hetmet.git] / compiler / nativeGen / RegSpillClean.hs
index df6686e..a4be8ed 100644 (file)
@@ -22,7 +22,7 @@
 --     This also works if the reloads in B1/B2 were spills instead, because
 --     spilling %r1 to a slot makes that slot have the same value as %r1.
 --
---
+
 module RegSpillClean (
        cleanSpills
 )
@@ -37,7 +37,6 @@ import Cmm
 import UniqSet
 import UniqFM
 import State
-import Outputable
 
 import Data.Maybe
 import Data.List
@@ -118,10 +117,10 @@ cleanReload
        -> [LiveInstr]          -- ^ instrs to clean (in backwards order)
        -> CleanM [LiveInstr]   -- ^ cleaned instrs  (in forward   order)
 
-cleanReload assoc acc []
+cleanReload _ acc []
        = return acc
 
-cleanReload assoc acc (li@(Instr instr live) : instrs)
+cleanReload assoc acc (li@(Instr instr _) : instrs)
 
        | SPILL reg slot        <- instr
        = let   assoc'  = addAssoc reg slot     -- doing the spill makes reg and slot the same value
@@ -146,13 +145,13 @@ cleanReload assoc acc (li@(Instr instr live) : instrs)
            in  cleanReload assoc' (li : acc) instrs
 
        -- on a jump, remember the reg/slot association.
-       | targets               <- jumpDests instr []
+       | targets       <- jumpDests instr []
        , not $ null targets
        = do    mapM_ (accJumpValid assoc) targets
                cleanReload assoc (li : acc) instrs
 
        -- writing to a reg changes its value.
-       | RU read written       <- regUsage instr
+       | RU _ written  <- regUsage instr
        = let assoc'    = foldr deleteAAssoc assoc written
          in  cleanReload assoc' (li : acc) instrs
 
@@ -168,11 +167,11 @@ cleanSpill
        -> [LiveInstr]          -- ^ instrs to clean (in forwards order)
        -> CleanM [LiveInstr]   -- ^ cleaned instrs  (in backwards order)
 
-cleanSpill unused acc []
+cleanSpill _      acc []
        = return  acc
 
-cleanSpill unused acc (li@(Instr instr live) : instrs)
-       | SPILL reg slot        <- instr
+cleanSpill unused acc (li@(Instr instr _) : instrs)
+       | SPILL _ slot  <- instr
        = if elementOfUniqSet slot unused
 
           -- we can erase this spill because the slot won't be read until after the next one
@@ -186,7 +185,7 @@ cleanSpill unused acc (li@(Instr instr live) : instrs)
                cleanSpill unused' (li : acc) instrs
 
        -- if we reload from a slot then it's no longer unused
-       | RELOAD slot reg       <- instr
+       | RELOAD slot _         <- instr
        , unused'               <- delOneFromUniqSet unused slot
        = cleanSpill unused' (li : acc) instrs
 
@@ -231,6 +230,7 @@ data CleanS
        , sCleanedSpillsAcc     :: Int
        , sCleanedReloadsAcc    :: Int }
 
+initCleanS :: CleanS
 initCleanS
        = CleanS
        { sJumpValid            = emptyUFM