From 11c9fdd38fbed1deb6c88a68c2712d51bc50a0e2 Mon Sep 17 00:00:00 2001
From: sewardj <unknown>
Date: Tue, 20 Jun 2000 15:31:33 +0000
Subject: [PATCH] [project @ 2000-06-20 15:31:33 by sewardj] 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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs
index 4d2d4fda98f7..11b14f10a81b 100644
--- a/ghc/compiler/simplCore/SimplCore.lhs
+++ b/ghc/compiler/simplCore/SimplCore.lhs
@@ -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 } ;
-- 
GitLab