summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-03-15 13:07:57 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-03-15 13:25:16 +0000
commitdaa2d5e3f2347677dea54d2b6853e8832132f6a8 (patch)
tree809ca9be6b85dd28b9868026c08ddc3598541038
parentbb7d711c4bb32096df938b30e1c455bc95420db5 (diff)
downloadhaskell-daa2d5e3f2347677dea54d2b6853e8832132f6a8.tar.gz
a bit more UNPACKing
-rw-r--r--compiler/cmm/CmmExpr.hs9
-rw-r--r--compiler/cmm/CmmNode.hs11
2 files changed, 12 insertions, 8 deletions
diff --git a/compiler/cmm/CmmExpr.hs b/compiler/cmm/CmmExpr.hs
index 1a9382d5eb..3b6fec6925 100644
--- a/compiler/cmm/CmmExpr.hs
+++ b/compiler/cmm/CmmExpr.hs
@@ -43,10 +43,11 @@ import qualified Data.Set as Set
data CmmExpr
= CmmLit CmmLit -- Literal
- | CmmLoad !CmmExpr !CmmType -- Read memory location
+ | CmmLoad !CmmExpr !CmmType -- Read memory location
| CmmReg !CmmReg -- Contents of register
| CmmMachOp MachOp [CmmExpr] -- Machine operation (+, -, *, etc.)
- | CmmStackSlot Area Int -- addressing expression of a stack slot
+ | CmmStackSlot Area {-# UNPACK #-} !Int
+ -- addressing expression of a stack slot
| CmmRegOff !CmmReg Int
-- CmmRegOff reg i
-- ** is shorthand only, meaning **
@@ -71,7 +72,7 @@ data CmmReg
-- or the stack space where function arguments and results are passed.
data Area
= Old -- See Note [Old Area]
- | Young BlockId -- Invariant: must be a continuation BlockId
+ | Young {-# UNPACK #-} !BlockId -- Invariant: must be a continuation BlockId
-- See Note [Continuation BlockId] in CmmNode.
deriving (Eq, Ord)
@@ -111,7 +112,7 @@ data CmmLit
-- position-independent code.
| CmmLabelDiffOff CLabel CLabel Int -- label1 - label2 + offset
- | CmmBlock BlockId -- Code label
+ | CmmBlock {-# UNPACK #-} !BlockId -- Code label
-- Invariant: must be a continuation BlockId
-- See Note [Continuation BlockId] in CmmNode.
diff --git a/compiler/cmm/CmmNode.hs b/compiler/cmm/CmmNode.hs
index 7b8ee55029..cd46794580 100644
--- a/compiler/cmm/CmmNode.hs
+++ b/compiler/cmm/CmmNode.hs
@@ -35,8 +35,10 @@ import Prelude hiding (succ)
------------------------
-- CmmNode
+#define ULabel {-# UNPACK #-} !Label
+
data CmmNode e x where
- CmmEntry :: {-# UNPACK #-} !Label -> CmmNode C O
+ CmmEntry :: ULabel -> CmmNode C O
CmmComment :: FastString -> CmmNode O O
@@ -60,11 +62,12 @@ data CmmNode e x where
-- bug for what can be put in arguments, see
-- Note [Register Parameter Passing]
- CmmBranch :: Label -> CmmNode O C -- Goto another block in the same procedure
+ CmmBranch :: ULabel -> CmmNode O C
+ -- Goto another block in the same procedure
CmmCondBranch :: { -- conditional branch
cml_pred :: CmmExpr,
- cml_true, cml_false :: Label
+ cml_true, cml_false :: ULabel
} -> CmmNode O C
CmmSwitch :: CmmExpr -> [Maybe Label] -> CmmNode O C -- Table branch
@@ -122,7 +125,7 @@ data CmmNode e x where
tgt :: ForeignTarget, -- call target and convention
res :: [CmmFormal], -- zero or more results
args :: [CmmActual], -- zero or more arguments; see Note [Register parameter passing]
- succ :: Label, -- Label of continuation
+ succ :: ULabel, -- Label of continuation
updfr :: UpdFrameOffset, -- where the update frame is (for building infotable)
intrbl:: Bool -- whether or not the call is interruptible
} -> CmmNode O C