diff options
author | simonmar <unknown> | 2001-03-13 12:50:33 +0000 |
---|---|---|
committer | simonmar <unknown> | 2001-03-13 12:50:33 +0000 |
commit | 10cbc75d37064b3ef76ca3ccd219d66e445ecb0f (patch) | |
tree | 6c0b7b769b0b377081026893bfe6f4922ae00c3a /ghc/compiler/codeGen/CodeGen.lhs | |
parent | b0b4be02492583fc9ca4726c85793afe5c6d0171 (diff) | |
download | haskell-10cbc75d37064b3ef76ca3ccd219d66e445ecb0f.tar.gz |
[project @ 2001-03-13 12:50:29 by simonmar]
Some rearrangements that Simon & I have been working on recently:
- CoreSat is now CorePrep, and is a general "prepare-for-code-
generation" pass. It does cloning, saturation of constructors &
primops, A-normal form, and a couple of other minor fiddlings.
- CoreTidy no longer does cloning, and minor fiddlings. It doesn't
need the unique supply any more, so that's removed.
- CoreToStg now collects CafInfo and the list of CafRefs for each
binding. The SRT pass is much simpler now.
- IdInfo now has a CgInfo field for "code generator info". It currently
contains arity (the actual code gen arity which affects the calling
convention as opposed to the ArityInfo which is a measure of how
many arguments the Id can be applied to before it does any work), and
CafInfo.
Previously we overloaded the ArityInfo field to contain both
codegen arity and simplifier arity. Things are cleaner now.
- CgInfo is collected by CoreToStg, and passed back into CoreTidy in
a loop. The compiler will complain rather than going into a black
hole if the CgInfo is pulled on too early.
- Worker info in an interface file now comes with arity info attached.
Previously the main arity info was overloaded for this purpose, but
it lead to a few hacks in the compiler, this tidies things up somewhat.
Bottom line: we removed several fragilities, and tidied up a number of
things. Code size should be smaller, but we'll see...
Diffstat (limited to 'ghc/compiler/codeGen/CodeGen.lhs')
-rw-r--r-- | ghc/compiler/codeGen/CodeGen.lhs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ghc/compiler/codeGen/CodeGen.lhs b/ghc/compiler/codeGen/CodeGen.lhs index bf6177df7f..5db06d0bb4 100644 --- a/ghc/compiler/codeGen/CodeGen.lhs +++ b/ghc/compiler/codeGen/CodeGen.lhs @@ -188,7 +188,7 @@ variable. \begin{code} cgTopBinding :: (StgBinding,[Id]) -> Code -cgTopBinding (StgNonRec id rhs, srt) +cgTopBinding (StgNonRec srt_info id rhs, srt) = absC maybeSplitCode `thenC` maybeGlobaliseId id `thenFC` \ id' -> let @@ -196,11 +196,11 @@ cgTopBinding (StgNonRec id rhs, srt) in mkSRT srt_label srt [] `thenC` setSRTLabel srt_label ( - cgTopRhs id' rhs `thenFC` \ (id, info) -> + cgTopRhs id' rhs srt_info `thenFC` \ (id, info) -> addBindC id info ) -cgTopBinding (StgRec pairs, srt) +cgTopBinding (StgRec srt_info pairs, srt) = absC maybeSplitCode `thenC` let (bndrs, rhss) = unzip pairs @@ -214,7 +214,7 @@ cgTopBinding (StgRec pairs, srt) setSRTLabel srt_label ( fixC (\ new_binds -> addBindsC new_binds `thenC` - mapFCs ( \ (b,e) -> cgTopRhs b e ) pairs' + mapFCs ( \ (b,e) -> cgTopRhs b e srt_info ) pairs' ) `thenFC` \ new_binds -> nopC ) @@ -256,18 +256,18 @@ maybeSplitCode -- to enclose the listFCs in cgTopBinding, but that tickled the -- statics "error" call in initC. I DON'T UNDERSTAND WHY! -cgTopRhs :: Id -> StgRhs -> FCode (Id, CgIdInfo) +cgTopRhs :: Id -> StgRhs -> SRT -> FCode (Id, CgIdInfo) -- the Id is passed along for setting up a binding... -cgTopRhs bndr (StgRhsCon cc con args) +cgTopRhs bndr (StgRhsCon cc con args) srt = maybeGlobaliseId bndr `thenFC` \ bndr' -> forkStatics (cgTopRhsCon bndr con args) -cgTopRhs bndr (StgRhsClosure cc bi srt fvs upd_flag args body) +cgTopRhs bndr (StgRhsClosure cc bi fvs upd_flag args body) srt = -- There should be no free variables ASSERT(null fvs) -- If the closure is a thunk, then the binder must be recorded as such. - ASSERT2(not (isUpdatable upd_flag) || mayHaveCafRefs (idCafInfo bndr), ppr bndr) +-- ASSERT2(not (isUpdatable upd_flag) || mayHaveCafRefs (idCafInfo bndr), ppr bndr) getSRTLabel `thenFC` \srt_label -> let lf_info = |