[project @ 2000-06-20 15:31:33 by sewardj]
authorsewardj <unknown>
Tue, 20 Jun 2000 15:31:33 +0000 (15:31 +0000)
committersewardj <unknown>
Tue, 20 Jun 2000 15:31:33 +0000 (15:31 +0000)
Force binds with coreBindsSize after every simplifier iteration.
Significantly reduces space use, especially with -O.  This could
probably be done more cleanly.

ghc/compiler/simplCore/SimplCore.lhs

index 4d2d4fd..11b14f1 100644 (file)
@@ -26,7 +26,7 @@ import Rules          ( RuleBase, ProtoCoreRule(..), pprProtoCoreRule, prepareLocalRuleB
 import CoreUnfold
 import PprCore         ( pprCoreBindings )
 import OccurAnal       ( occurAnalyseBinds )
-import CoreUtils       ( exprIsTrivial, etaReduceExpr )
+import CoreUtils       ( exprIsTrivial, etaReduceExpr, coreBindsSize )
 import Simplify                ( simplTopBinds, simplExpr )
 import SimplUtils      ( findDefault, simplBinders )
 import SimplMonad
@@ -283,6 +283,9 @@ simplifyPgm (imported_rule_ids, rule_lhs_fvs)
                         | otherwise               = empty
 
     iteration us iteration_no counts binds
+      -- Try and force thunks off the binds; significantly reduces
+      -- space usage, especially with -O.  JRS, 000620.
+      | let sz = coreBindsSize binds in sz == sz
       = do {
                -- Occurrence analysis
           let { tagged_binds = _scc_ "OccAnal" occurAnalyseBinds binds } ;