summaryrefslogtreecommitdiff
path: root/ghc/compiler/simplCore/SimplCore.lhs
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-03-13 12:50:33 +0000
committersimonmar <unknown>2001-03-13 12:50:33 +0000
commit10cbc75d37064b3ef76ca3ccd219d66e445ecb0f (patch)
tree6c0b7b769b0b377081026893bfe6f4922ae00c3a /ghc/compiler/simplCore/SimplCore.lhs
parentb0b4be02492583fc9ca4726c85793afe5c6d0171 (diff)
downloadhaskell-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/simplCore/SimplCore.lhs')
-rw-r--r--ghc/compiler/simplCore/SimplCore.lhs15
1 files changed, 8 insertions, 7 deletions
diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs
index 47addf32eb..7197e77a72 100644
--- a/ghc/compiler/simplCore/SimplCore.lhs
+++ b/ghc/compiler/simplCore/SimplCore.lhs
@@ -62,24 +62,25 @@ core2core :: DynFlags -- includes spec of what core-to-core passes to do
-> PersistentCompilerState
-> HomeSymbolTable
-> IsExported
- -> [CoreBind] -- Binds in
- -> [IdCoreRule] -- Rules defined in this module
- -> IO ([CoreBind], [IdCoreRule]) -- binds, local orphan rules out
+ -> ModDetails
+ -> IO ModDetails
-core2core dflags pcs hst is_exported binds rules
+core2core dflags pcs hst is_exported
+ mod_details@(ModDetails { md_binds = binds_in, md_rules = rules_in })
= do
let core_todos = dopt_CoreToDo dflags
let pkg_rule_base = pcs_rules pcs -- Rule-base accumulated from imported packages
+
us <- mkSplitUniqSupply 's'
let (cp_us, ru_us) = splitUniqSupply us
-- COMPUTE THE RULE BASE TO USE
(rule_base, local_rule_ids, orphan_rules, rule_rhs_fvs)
- <- prepareRules dflags pkg_rule_base hst ru_us binds rules
+ <- prepareRules dflags pkg_rule_base hst ru_us binds_in rules_in
-- PREPARE THE BINDINGS
- let binds1 = updateBinders local_rule_ids rule_rhs_fvs is_exported binds
+ let binds1 = updateBinders local_rule_ids rule_rhs_fvs is_exported binds_in
-- DO THE BUSINESS
(stats, processed_binds)
@@ -92,7 +93,7 @@ core2core dflags pcs hst is_exported binds rules
-- Return results
-- We only return local orphan rules, i.e., local rules not attached to an Id
-- The bindings cotain more rules, embedded in the Ids
- return (processed_binds, orphan_rules)
+ return (mod_details { md_binds = processed_binds, md_rules = orphan_rules})
simplifyExpr :: DynFlags -- includes spec of what core-to-core passes to do