summaryrefslogtreecommitdiff
path: root/compiler/cmm/CmmSpillReload.hs
diff options
context:
space:
mode:
authorNorman Ramsey <nr@eecs.harvard.edu>2007-09-12 15:38:52 +0000
committerNorman Ramsey <nr@eecs.harvard.edu>2007-09-12 15:38:52 +0000
commitb822c1e46cd64d1dba23fbab0f775b731bf0f12b (patch)
treeb7aa9101366937abc5440efdb69e1b8b5e709715 /compiler/cmm/CmmSpillReload.hs
parentd068f78b3ae99da8976e0836739cde6213c40041 (diff)
downloadhaskell-b822c1e46cd64d1dba23fbab0f775b731bf0f12b.tar.gz
change the zipper representation of calls
This patch combines two changes: 1. As requested by SimonPJ, the redundancy inherent in having LastCall bear actual parameters has been removed. The actual parameters are now carried by a separate CopyOut node. 2. The internal (to zipper) representation of calls has changed; the representation of calling conventions is more orthogonal, and there is now no such thing as a 'safe' or 'final' call to a CallishMachOp. This change has affected the interface to MkZipCfgCmm, which now provides a static guarantee. Simon's new upstream code will be affected; I've patched the existing code in CmmCvt (which becomes ever hairier).
Diffstat (limited to 'compiler/cmm/CmmSpillReload.hs')
-rw-r--r--compiler/cmm/CmmSpillReload.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs
index b588c46af6..6195a4ca11 100644
--- a/compiler/cmm/CmmSpillReload.hs
+++ b/compiler/cmm/CmmSpillReload.hs
@@ -114,16 +114,16 @@ middleDualLiveness live (NotSpillOrReload m) = changeRegs (middleLiveness m) liv
lastDualLiveness :: (BlockId -> DualLive) -> Last -> DualLive
lastDualLiveness env l = last l
- where last (LastReturn ress) = changeRegs (gen ress) empty
- last (LastJump e args) = changeRegs (gen e . gen args) empty
- last (LastBranch id args) = changeRegs (gen args) $ env id
- last (LastCall tgt args Nothing) = changeRegs (gen tgt. gen args) empty
- last (LastCall tgt args (Just k)) =
+ where last (LastReturn ress) = changeRegs (gen ress) empty
+ last (LastJump e args) = changeRegs (gen e . gen args) empty
+ last (LastBranch id args) = changeRegs (gen args) $ env id
+ last (LastCall tgt Nothing) = changeRegs (gen tgt) empty
+ last (LastCall tgt (Just k)) =
-- nothing can be live in registers at this point
-- only 'formals' can be in regs at this point
let live = env k in
if isEmptyUniqSet (in_regs live) then
- DualLive (on_stack live) (gen tgt $ gen args emptyRegSet)
+ DualLive (on_stack live) (gen tgt emptyRegSet)
else
panic "live values in registers at call continuation"
last (LastCondBranch e t f) = changeRegs (gen e) $ dualUnion (env t) (env f)
@@ -265,7 +265,7 @@ middleAvail (NotSpillOrReload m) = middle m
middle (CopyOut {}) = id
lastAvail :: AvailRegs -> Last -> LastOutFacts AvailRegs
-lastAvail _ (LastCall _ _ (Just k)) = LastOutFacts [(k, AvailRegs emptyRegSet)]
+lastAvail _ (LastCall _ (Just k)) = LastOutFacts [(k, AvailRegs emptyRegSet)]
lastAvail avail l = LastOutFacts $ map (\id -> (id, avail)) $ succs l