Commit 0d80489c authored by dias@eecs.harvard.edu's avatar dias@eecs.harvard.edu

Replacing copyins and copyouts with data-movement instructions

o Moved BlockId stuff to a new file to avoid module recursion
o Defined stack areas for parameter-passing locations and spill slots
o Part way through replacing copy in and copy out nodes
  - added movement instructions for stack pointer
  - added movement instructions for call and return parameters
    (but not with the proper calling conventions)
o Inserting spills and reloads for proc points is now procpoint-aware
  (it was relying on the presence of a CopyIn node as a proxy for
   procpoint knowledge)
o Changed ZipDataflow to expect AGraphs (instead of being polymorphic in
   the type of graph)
parent 724a9e83
module StackSlot module BlockId
( BlockId(..), mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet ( BlockId(..), mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet
, BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv , BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv
, BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet, sizeBlockSet, mkBlockSet , BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet, sizeBlockSet, mkBlockSet
, StackArea, mkStackArea, outgoingSlot ) where
, StackSlot(..)) where -- StackSlot should probably be abstract
-- Why is the BlockId here? To avoid recursive module problems.
import Monad
import Outputable import Outputable
import Unique
import UniqFM import UniqFM
import Unique
import UniqSet import UniqSet
-- A stack area is represented by three pieces:
-- o The BlockId of the return site.
-- Maybe during the conversion to VFP offsets, this BlockId will be the entry point.
-- o The size of the outgoing parameter space
-- o The size of the incoming parameter space, if the function returns
data StackArea = StackArea BlockId Int (Maybe Int)
deriving (Eq, Ord)
instance Outputable StackArea where
ppr (StackArea bid f a) =
text "StackArea" <+> ppr bid <+> text "[" <+> ppr f <+> text "," <+> ppr a <+> text ")"
-- Eventually, we'll want something proper that takes arguments and formals
-- and gives you back the calling convention code, as well as the stack area.
--mkStackArea :: BlockId -> CmmActuals -> CmmFormals -> (StackArea, ...)
-- But for now...
mkStackArea :: BlockId -> [a] -> Maybe [b] -> StackArea
mkStackArea k as fs = StackArea k (length as) (liftM length fs)
-- A stack slot is an offset from the base of a stack area.
data StackSlot = StackSlot StackArea Int
deriving (Eq, Ord)
-- Return the last slot in the outgoing parameter area.
outgoingSlot :: StackArea -> StackSlot
outgoingSlot a@(StackArea _ outN _) = StackSlot a outN
instance Outputable StackSlot where
ppr (StackSlot (StackArea bid _ _) n) =
text "Stack(" <+> ppr bid <+> text "," <+> ppr n <+> text ")"
---------------------------------------------------------------- ----------------------------------------------------------------
--- Block Ids, their environments, and their sets --- Block Ids, their environments, and their sets
...@@ -94,4 +58,3 @@ mkBlockSet :: [BlockId] -> BlockSet ...@@ -94,4 +58,3 @@ mkBlockSet :: [BlockId] -> BlockSet
mkBlockSet = mkUniqSet mkBlockSet = mkUniqSet
sizeBlockSet :: BlockSet -> Int sizeBlockSet :: BlockSet -> Int
sizeBlockSet = sizeUniqSet sizeBlockSet = sizeUniqSet
...@@ -23,14 +23,11 @@ module Cmm ( ...@@ -23,14 +23,11 @@ module Cmm (
CmmCallTarget(..), CmmCallTarget(..),
CmmStatic(..), Section(..), CmmStatic(..), Section(..),
module CmmExpr, module CmmExpr,
BlockId(..), mkBlockId,
BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv,
BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet,
) where ) where
#include "HsVersions.h" #include "HsVersions.h"
import BlockId
import CmmExpr import CmmExpr
import MachOp import MachOp
import CLabel import CLabel
...@@ -42,10 +39,6 @@ import FastString ...@@ -42,10 +39,6 @@ import FastString
import Data.Word import Data.Word
import StackSlot ( BlockId(..), mkBlockId
, BlockEnv, emptyBlockEnv, lookupBlockEnv, extendBlockEnv, mkBlockEnv
, BlockSet, emptyBlockSet, elemBlockSet, extendBlockSet
)
-- A [[BlockId]] is a local label. -- A [[BlockId]] is a local label.
-- Local labels must be unique within an entire compilation unit, not -- Local labels must be unique within an entire compilation unit, not
...@@ -277,7 +270,6 @@ instance UserOfLocalRegs CmmCallTarget where ...@@ -277,7 +270,6 @@ instance UserOfLocalRegs CmmCallTarget where
instance DefinerOfLocalRegs a => DefinerOfLocalRegs (CmmKinded a) where instance DefinerOfLocalRegs a => DefinerOfLocalRegs (CmmKinded a) where
foldRegsDefd f z (CmmKinded x _) = foldRegsDefd f z x foldRegsDefd f z (CmmKinded x _) = foldRegsDefd f z x
--just look like a tuple, since it was a tuple before --just look like a tuple, since it was a tuple before
-- ... is that a good idea? --Isaac Dupree -- ... is that a good idea? --Isaac Dupree
instance (Outputable a) => Outputable (CmmKinded a) where instance (Outputable a) => Outputable (CmmKinded a) where
......
...@@ -20,6 +20,7 @@ module CmmBrokenBlock ( ...@@ -20,6 +20,7 @@ module CmmBrokenBlock (
#include "HsVersions.h" #include "HsVersions.h"
import BlockId
import Cmm import Cmm
import CmmUtils import CmmUtils
import CLabel import CLabel
......
...@@ -13,6 +13,7 @@ module CmmCPS ( ...@@ -13,6 +13,7 @@ module CmmCPS (
#include "HsVersions.h" #include "HsVersions.h"
import BlockId
import Cmm import Cmm
import CmmLint import CmmLint
import PprCmm import PprCmm
......
...@@ -13,6 +13,7 @@ module CmmCPSGen ( ...@@ -13,6 +13,7 @@ module CmmCPSGen (
ContinuationFormat(..), ContinuationFormat(..),
) where ) where
import BlockId
import Cmm import Cmm
import CLabel import CLabel
import CmmBrokenBlock -- Data types only import CmmBrokenBlock -- Data types only
......
...@@ -5,6 +5,7 @@ module CmmCPSZ ( ...@@ -5,6 +5,7 @@ module CmmCPSZ (
protoCmmCPSZ protoCmmCPSZ
) where ) where
import BlockId
import Cmm import Cmm
import CmmCommonBlockElimZ import CmmCommonBlockElimZ
import CmmContFlowOpt import CmmContFlowOpt
...@@ -53,14 +54,13 @@ cpsTop _ p@(CmmData {}) = return p ...@@ -53,14 +54,13 @@ cpsTop _ p@(CmmData {}) = return p
cpsTop hsc_env (CmmProc h l args g) = cpsTop hsc_env (CmmProc h l args g) =
do dump Opt_D_dump_cmmz "Pre Proc Points Added" g do dump Opt_D_dump_cmmz "Pre Proc Points Added" g
let callPPs = callProcPoints g let callPPs = callProcPoints g
procPoints <- run $ minimalProcPointSet callPPs (runTx cmmCfgOptsZ g)
let varSlots = emptyFM
g <- return $ map_nodes id NotSpillOrReload id g g <- return $ map_nodes id NotSpillOrReload id g
-- Change types of middle nodes to allow spill/reload -- Change types of middle nodes to allow spill/reload
g <- dual_rewrite Opt_D_dump_cmmz "spills and reloads" g <- dual_rewrite Opt_D_dump_cmmz "spills and reloads"
(dualLivenessWithInsertion emptyBlockSet) g (dualLivenessWithInsertion callPPs) g
(varSlots, g) <- trim g >>= run . elimSpillAndReload varSlots (varSlots, g) <- trim g >>= return . elimSpillAndReload emptyFM
g <- run $ addProcPointProtocols callPPs procPoints args g procPoints <- run $ minimalProcPointSet callPPs (runTx cmmCfgOptsZ g)
g <- run $ addProcPointProtocols callPPs procPoints g
dump Opt_D_dump_cmmz "Post Proc Points Added" g dump Opt_D_dump_cmmz "Post Proc Points Added" g
g <- return $ map_nodes id NotSpillOrReload id g g <- return $ map_nodes id NotSpillOrReload id g
-- Change types of middle nodes to allow spill/reload -- Change types of middle nodes to allow spill/reload
...@@ -72,7 +72,7 @@ cpsTop hsc_env (CmmProc h l args g) = ...@@ -72,7 +72,7 @@ cpsTop hsc_env (CmmProc h l args g) =
g <- trim g >>= dual_rewrite Opt_D_dump_cmmz "Dead Assignment Elimination" g <- trim g >>= dual_rewrite Opt_D_dump_cmmz "Dead Assignment Elimination"
(removeDeadAssignmentsAndReloads procPoints) (removeDeadAssignmentsAndReloads procPoints)
-- Remove redundant reloads (and any other redundant asst) -- Remove redundant reloads (and any other redundant asst)
(_, g) <- trim g >>= run . elimSpillAndReload varSlots (_, g) <- trim g >>= return . elimSpillAndReload varSlots
gs <- run $ splitAtProcPoints args l procPoints g gs <- run $ splitAtProcPoints args l procPoints g
gs `seq` dump Opt_D_dump_cmmz "Pre common block elimination" g gs `seq` dump Opt_D_dump_cmmz "Pre common block elimination" g
g <- return $ elimCommonBlocks g g <- return $ elimCommonBlocks g
......
...@@ -4,6 +4,7 @@ module CmmCommonBlockElimZ ...@@ -4,6 +4,7 @@ module CmmCommonBlockElimZ
where where
import BlockId
import Cmm hiding (blockId) import Cmm hiding (blockId)
import CmmExpr import CmmExpr
import Prelude hiding (iterate, zip, unzip) import Prelude hiding (iterate, zip, unzip)
...@@ -89,13 +90,13 @@ hash_block (Block _ t) = hash_tail t 0 ...@@ -89,13 +90,13 @@ hash_block (Block _ t) = hash_tail t 0
hash_mid (CopyOut _ as) = hash_as as hash_mid (CopyOut _ as) = hash_as as
hash_reg (CmmLocal l) = hash_local l hash_reg (CmmLocal l) = hash_local l
hash_reg (CmmGlobal _) = 19 hash_reg (CmmGlobal _) = 19
hash_reg (CmmStack _) = 13
hash_local (LocalReg _ _ _) = 117 hash_local (LocalReg _ _ _) = 117
hash_e (CmmLit l) = hash_lit l hash_e (CmmLit l) = hash_lit l
hash_e (CmmLoad e _) = 67 + hash_e e hash_e (CmmLoad e _) = 67 + hash_e e
hash_e (CmmReg r) = hash_reg r hash_e (CmmReg r) = hash_reg r
hash_e (CmmMachOp _ es) = hash_lst hash_e es -- pessimal - no operator check hash_e (CmmMachOp _ es) = hash_lst hash_e es -- pessimal - no operator check
hash_e (CmmRegOff r i) = hash_reg r + i hash_e (CmmRegOff r i) = hash_reg r + i
hash_e (CmmStackSlot _ _) = 13
hash_lit (CmmInt i _) = fromInteger i hash_lit (CmmInt i _) = fromInteger i
hash_lit (CmmFloat r _) = truncate r hash_lit (CmmFloat r _) = truncate r
hash_lit (CmmLabel _) = 119 -- ugh hash_lit (CmmLabel _) = 119 -- ugh
......
...@@ -6,10 +6,10 @@ module CmmContFlowOpt ...@@ -6,10 +6,10 @@ module CmmContFlowOpt
) )
where where
import BlockId
import Cmm import Cmm
import CmmTx import CmmTx
import qualified ZipCfg as G import qualified ZipCfg as G
import StackSlot
import ZipCfgCmmRep import ZipCfgCmmRep
import Maybes import Maybes
......
...@@ -4,6 +4,7 @@ module CmmCvt ...@@ -4,6 +4,7 @@ module CmmCvt
( cmmToZgraph, cmmOfZgraph ) ( cmmToZgraph, cmmOfZgraph )
where where
import BlockId
import Cmm import Cmm
import CmmExpr import CmmExpr
import MkZipCfg import MkZipCfg
...@@ -36,7 +37,7 @@ cmmOfZgraph = cmmMapGraph ofZgraph ...@@ -36,7 +37,7 @@ cmmOfZgraph = cmmMapGraph ofZgraph
toZgraph :: String -> CmmFormalsWithoutKinds -> ListGraph CmmStmt -> UniqSM CmmGraph toZgraph :: String -> CmmFormalsWithoutKinds -> ListGraph CmmStmt -> UniqSM CmmGraph
toZgraph _ _ (ListGraph []) = lgraphOfAGraph emptyAGraph toZgraph _ _ (ListGraph []) = lgraphOfAGraph emptyAGraph
toZgraph fun_name args g@(ListGraph (BasicBlock id ss : other_blocks)) = toZgraph fun_name args g@(ListGraph (BasicBlock id ss : other_blocks)) =
labelAGraph id $ mkMiddles (mkEntry id undefined args) <*> labelAGraph id $ mkMiddles (mkEntry area undefined args) <*>
mkStmts ss <*> foldr addBlock emptyAGraph other_blocks mkStmts ss <*> foldr addBlock emptyAGraph other_blocks
where addBlock (BasicBlock id ss) g = mkLabel id <*> mkStmts ss <*> g where addBlock (BasicBlock id ss) g = mkLabel id <*> mkStmts ss <*> g
mkStmts (CmmNop : ss) = mkNop <*> mkStmts ss mkStmts (CmmNop : ss) = mkNop <*> mkStmts ss
...@@ -60,12 +61,28 @@ toZgraph fun_name args g@(ListGraph (BasicBlock id ss : other_blocks)) = ...@@ -60,12 +61,28 @@ toZgraph fun_name args g@(ListGraph (BasicBlock id ss : other_blocks)) =
mkLast (CmmCall (CmmPrim {}) _ _ _ CmmNeverReturns) = mkLast (CmmCall (CmmPrim {}) _ _ _ CmmNeverReturns) =
panic "Call to CmmPrim never returns?!" panic "Call to CmmPrim never returns?!"
mkLast (CmmSwitch scrutinee table) = mkSwitch scrutinee table mkLast (CmmSwitch scrutinee table) = mkSwitch scrutinee table
mkLast (CmmJump tgt args) = mkJump tgt args mkLast (CmmJump tgt args) = mkJump area tgt args
mkLast (CmmReturn ress) = mkReturn ress mkLast (CmmReturn ress) = mkReturn area ress
mkLast (CmmBranch tgt) = mkBranch tgt mkLast (CmmBranch tgt) = mkBranch tgt
mkLast (CmmCall _f (_:_) _args _ CmmNeverReturns) = mkLast (CmmCall _f (_:_) _args _ CmmNeverReturns) =
panic "Call never returns but has results?!" panic "Call never returns but has results?!"
mkLast _ = panic "fell off end of block" mkLast _ = panic "fell off end of block"
-- The entry, jump, and return areas should be the same.
-- This code is horrible, but there's no point trying to fix it until we've figured
-- out our interface for calling conventions.
-- All return statements are required to use return areas of equal size.
-- This isn't necessarily required to write correct programs, but it's sane.
area = case foldr retBlock (retStmts ss Nothing) other_blocks of
Just (as, _) -> mkCallArea id as $ Just args
Nothing -> mkCallArea id [] $ Just args
retBlock (BasicBlock _ ss) z = retStmts ss z
retStmts [CmmReturn ress] z@(Just (_, n)) =
if size ress == n then z
else panic "return statements in C-- procs must return the same results"
retStmts [CmmReturn ress] Nothing = Just (ress, size ress)
retStmts (_ : rst) z = retStmts rst z
retStmts [] z = z
size args = areaSize $ mkCallArea id args Nothing
ofZgraph :: CmmGraph -> ListGraph CmmStmt ofZgraph :: CmmGraph -> ListGraph CmmStmt
ofZgraph g = ListGraph $ swallow blocks ofZgraph g = ListGraph $ swallow blocks
......
...@@ -8,19 +8,18 @@ module CmmExpr ...@@ -8,19 +8,18 @@ module CmmExpr
, DefinerOfLocalRegs, UserOfLocalRegs, foldRegsDefd, foldRegsUsed, filterRegsUsed , DefinerOfLocalRegs, UserOfLocalRegs, foldRegsDefd, foldRegsUsed, filterRegsUsed
, RegSet, emptyRegSet, elemRegSet, extendRegSet, deleteFromRegSet, mkRegSet , RegSet, emptyRegSet, elemRegSet, extendRegSet, deleteFromRegSet, mkRegSet
, plusRegSet, minusRegSet, timesRegSet , plusRegSet, minusRegSet, timesRegSet
, StackSlotMap, getSlot , Area(..), StackSlotMap, getSlot, mkCallArea, outgoingSlot, areaId, areaSize
) ) where
where
import BlockId
import CLabel import CLabel
import FiniteMap import FiniteMap
import MachOp import MachOp
import Maybes
import Monad import Monad
import Panic import Panic
import StackSlot
import Unique import Unique
import UniqSet import UniqSet
import UniqSupply
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- CmmExpr -- CmmExpr
...@@ -37,14 +36,21 @@ data CmmExpr ...@@ -37,14 +36,21 @@ data CmmExpr
-- ** is shorthand only, meaning ** -- ** is shorthand only, meaning **
-- CmmMachOp (MO_S_Add rep (CmmReg reg) (CmmLit (CmmInt i rep))) -- CmmMachOp (MO_S_Add rep (CmmReg reg) (CmmLit (CmmInt i rep)))
-- where rep = cmmRegRep reg -- where rep = cmmRegRep reg
| CmmStackSlot Area Int
deriving Eq deriving Eq
data CmmReg data CmmReg
= CmmLocal LocalReg = CmmLocal LocalReg
| CmmGlobal GlobalReg | CmmGlobal GlobalReg
| CmmStack StackSlot
deriving( Eq, Ord ) deriving( Eq, Ord )
-- | A stack area is either the stack slot where a variable is spilled
-- or the stack space where function arguments and results are passed.
data Area
= RegSlot LocalReg
| CallArea BlockId Int Int
deriving (Eq, Ord)
data CmmLit data CmmLit
= CmmInt Integer MachRep = CmmInt Integer MachRep
-- Interpretation: the 2's complement representation of the value -- Interpretation: the 2's complement representation of the value
...@@ -119,19 +125,35 @@ timesRegSet = intersectUniqSets ...@@ -119,19 +125,35 @@ timesRegSet = intersectUniqSets
-- Stack slots -- Stack slots
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
mkVarSlot :: Unique -> CmmReg -> StackSlot mkVarSlot :: LocalReg -> CmmExpr
mkVarSlot id r = StackSlot (mkStackArea (mkBlockId id) [r] Nothing) 0 mkVarSlot r = CmmStackSlot (RegSlot r) 0
-- Usually, we either want to lookup a variable's spill slot in an environment -- Usually, we either want to lookup a variable's spill slot in an environment
-- or else allocate it and add it to the environment. -- or else allocate it and add it to the environment.
-- For a variable, we just need a single area of the appropriate size. -- For a variable, we just need a single area of the appropriate size.
type StackSlotMap = FiniteMap CmmReg StackSlot type StackSlotMap = FiniteMap LocalReg CmmExpr
getSlot :: MonadUnique m => StackSlotMap -> CmmReg -> m (StackSlotMap, StackSlot) getSlot :: StackSlotMap -> LocalReg -> (StackSlotMap, CmmExpr)
getSlot map r = case lookupFM map r of getSlot map r = case lookupFM map r of
Just s -> return (map, s) Just s -> (map, s)
Nothing -> do id <- getUniqueM Nothing -> (addToFM map r s, s) where s = mkVarSlot r
let s = mkVarSlot id r
return (addToFM map r s, s) -- Eventually, we'll want something proper that takes arguments and formals
-- and gives you back the calling convention code, as well as the stack area.
mkCallArea :: BlockId -> [a] -> Maybe [b] -> Area
mkCallArea id as fs = CallArea id (length as) (liftM length fs `orElse` 0)
-- Return the last slot in the outgoing parameter area.
outgoingSlot :: Area -> CmmExpr
outgoingSlot a@(RegSlot _) = CmmStackSlot a 0
outgoingSlot a@(CallArea _ outN _) = CmmStackSlot a outN
areaId :: Area -> BlockId
areaId (RegSlot _) = panic "Register stack slots don't have IDs!"
areaId (CallArea id _ _) = id
areaSize :: Area -> Int
areaSize (RegSlot _) = 1
areaSize (CallArea _ outN inN) = max outN inN
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
...@@ -152,12 +174,10 @@ filterRegsUsed p e = ...@@ -152,12 +174,10 @@ filterRegsUsed p e =
instance UserOfLocalRegs CmmReg where instance UserOfLocalRegs CmmReg where
foldRegsUsed f z (CmmLocal reg) = f z reg foldRegsUsed f z (CmmLocal reg) = f z reg
foldRegsUsed _ z (CmmGlobal _) = z foldRegsUsed _ z (CmmGlobal _) = z
foldRegsUsed _ z (CmmStack _) = z
instance DefinerOfLocalRegs CmmReg where instance DefinerOfLocalRegs CmmReg where
foldRegsDefd f z (CmmLocal reg) = f z reg foldRegsDefd f z (CmmLocal reg) = f z reg
foldRegsDefd _ z (CmmGlobal _) = z foldRegsDefd _ z (CmmGlobal _) = z
foldRegsDefd _ z (CmmStack _) = z
instance UserOfLocalRegs LocalReg where instance UserOfLocalRegs LocalReg where
foldRegsUsed f z r = f z r foldRegsUsed f z r = f z r
...@@ -175,6 +195,7 @@ instance UserOfLocalRegs CmmExpr where ...@@ -175,6 +195,7 @@ instance UserOfLocalRegs CmmExpr where
expr z (CmmReg r) = foldRegsUsed f z r expr z (CmmReg r) = foldRegsUsed f z r
expr z (CmmMachOp _ exprs) = foldRegsUsed f z exprs expr z (CmmMachOp _ exprs) = foldRegsUsed f z exprs
expr z (CmmRegOff r _) = foldRegsUsed f z r expr z (CmmRegOff r _) = foldRegsUsed f z r
expr z (CmmStackSlot _ _) = z
instance UserOfLocalRegs a => UserOfLocalRegs [a] where instance UserOfLocalRegs a => UserOfLocalRegs [a] where
foldRegsUsed _ set [] = set foldRegsUsed _ set [] = set
...@@ -196,11 +217,11 @@ cmmExprRep (CmmLoad _ rep) = rep ...@@ -196,11 +217,11 @@ cmmExprRep (CmmLoad _ rep) = rep
cmmExprRep (CmmReg reg) = cmmRegRep reg cmmExprRep (CmmReg reg) = cmmRegRep reg
cmmExprRep (CmmMachOp op _) = resultRepOfMachOp op cmmExprRep (CmmMachOp op _) = resultRepOfMachOp op
cmmExprRep (CmmRegOff reg _) = cmmRegRep reg cmmExprRep (CmmRegOff reg _) = cmmRegRep reg
cmmExprRep (CmmStackSlot _ _) = wordRep
cmmRegRep :: CmmReg -> MachRep cmmRegRep :: CmmReg -> MachRep
cmmRegRep (CmmLocal reg) = localRegRep reg cmmRegRep (CmmLocal reg) = localRegRep reg
cmmRegRep (CmmGlobal reg) = globalRegRep reg cmmRegRep (CmmGlobal reg) = globalRegRep reg
cmmRegRep (CmmStack _) = panic "cmmRegRep not yet defined on stack slots"
localRegRep :: LocalReg -> MachRep localRegRep :: LocalReg -> MachRep
localRegRep (LocalReg _ rep _) = rep localRegRep (LocalReg _ rep _) = rep
......
...@@ -16,6 +16,7 @@ module CmmLint ( ...@@ -16,6 +16,7 @@ module CmmLint (
cmmLint, cmmLintTop cmmLint, cmmLintTop
) where ) where
import BlockId
import Cmm import Cmm
import CLabel import CLabel
import MachOp import MachOp
......
...@@ -14,6 +14,7 @@ module CmmLive ( ...@@ -14,6 +14,7 @@ module CmmLive (
#include "HsVersions.h" #include "HsVersions.h"
import BlockId
import Cmm import Cmm
import Dataflow import Dataflow
......
...@@ -7,13 +7,13 @@ module CmmLiveZ ...@@ -7,13 +7,13 @@ module CmmLiveZ
) )
where where
import BlockId
import CmmExpr import CmmExpr
import CmmTx import CmmTx
import DFMonad import DFMonad
import Monad import Monad
import PprCmm() import PprCmm()
import PprCmmZ() import PprCmmZ()
import StackSlot
import ZipCfg import ZipCfg
import ZipDataflow import ZipDataflow
import ZipCfgCmmRep import ZipCfgCmmRep
......
...@@ -11,6 +11,7 @@ module CmmProcPoint ( ...@@ -11,6 +11,7 @@ module CmmProcPoint (
#include "HsVersions.h" #include "HsVersions.h"
import BlockId
import Cmm import Cmm
import CmmBrokenBlock import CmmBrokenBlock
import Dataflow import Dataflow
......
...@@ -8,6 +8,7 @@ where ...@@ -8,6 +8,7 @@ where
import Prelude hiding (zip, unzip, last) import Prelude hiding (zip, unzip, last)
import BlockId
import CLabel import CLabel
--import ClosureInfo --import ClosureInfo
import Cmm hiding (blockId) import Cmm hiding (blockId)
...@@ -17,7 +18,6 @@ import CmmLiveZ ...@@ -17,7 +18,6 @@ import CmmLiveZ
import CmmTx import CmmTx
import DFMonad import DFMonad
import FiniteMap import FiniteMap
import ForeignCall -- used in protocol for the entry point
import MachOp (MachHint(NoHint)) import MachOp (MachHint(NoHint))
import Maybes import Maybes
import MkZipCfgCmm hiding (CmmBlock, CmmGraph) import MkZipCfgCmm hiding (CmmBlock, CmmGraph)
...@@ -25,7 +25,6 @@ import Monad ...@@ -25,7 +25,6 @@ import Monad
import Name import Name
import Outputable import Outputable
import Panic import Panic
import StackSlot
import UniqFM import UniqFM
import UniqSet import UniqSet
import UniqSupply import UniqSupply
...@@ -230,7 +229,7 @@ algorithm would be just as good, so that's what we do. ...@@ -230,7 +229,7 @@ algorithm would be just as good, so that's what we do.
-} -}
data Protocol = Protocol Convention CmmFormals StackArea data Protocol = Protocol Convention CmmFormals Area
deriving Eq deriving Eq
instance Outputable Protocol where instance Outputable Protocol where
ppr (Protocol c fs a) = text "Protocol" <+> ppr c <+> ppr fs <+> ppr a