foldl1' was added to Data.List in GHC 6.4.x
[ghc-hetmet.git] / compiler / cmm / CmmProcPointZ.hs
index 279c730..0a87a65 100644 (file)
@@ -22,7 +22,7 @@ import Panic
 import UniqFM
 import UniqSet
 import ZipCfg
-import ZipCfgCmm 
+import ZipCfgCmmRep
 import ZipDataflow
 
 -- Compute a minimal set of proc points for a control-flow graph.
@@ -151,7 +151,7 @@ extendPPSet g blocks procPoints =
                   -- more proc points than b and is not already a proc
                   -- point.  If found, it can become a proc point.
                   newId succ_id = not (elemBlockSet succ_id procPoints') &&
-                                  nreached id > my_nreached 
+                                  nreached succ_id > my_nreached
               in  listToMaybe $ filter newId $ succs b
                                     
 
@@ -204,14 +204,14 @@ algorithm would be just as good, so that's what we do.
 
 -}
 
-data Protocol = Protocol Convention CmmHintFormals
+data Protocol = Protocol Convention CmmFormals
   deriving Eq
 
 -- | Function 'optimize_calls' chooses protocols only for those proc
 -- points that are relevant to the optimization explained above.
 -- The others are assigned by 'add_unassigned', which is not yet clever.
 
-addProcPointProtocols :: ProcPointSet -> CmmFormals -> CmmGraph -> CmmGraph
+addProcPointProtocols :: ProcPointSet -> CmmFormalsWithoutKinds -> CmmGraph -> CmmGraph
 addProcPointProtocols procPoints formals g =
        snd $ add_unassigned procPoints $ optimize_calls g
     where optimize_calls g =  -- see Note [Separate Adams optimization]
@@ -246,7 +246,7 @@ addProcPointProtocols procPoints formals g =
               let (Block _ t) = lookupBlockEnv (gr_blocks g) id `orElse`
                                 panic "jump out of graph"
               in case t of
-                   ZTail (CopyOut {}) (ZLast (LastOther (LastBranch pee [])))
+                   ZTail (CopyIn {}) (ZLast (LastOther (LastBranch pee [])))
                        | elemBlockSet pee procPoints -> Just pee
                    _ -> Nothing
           init_protocols = fold_blocks maybe_add_proto emptyBlockEnv g