Force binds with coreBindsSize after every simplifier iteration.
Significantly reduces space use, especially with -O. This could
probably be done more cleanly.
import CoreUnfold
import PprCore ( pprCoreBindings )
import OccurAnal ( occurAnalyseBinds )
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
import Simplify ( simplTopBinds, simplExpr )
import SimplUtils ( findDefault, simplBinders )
import SimplMonad
| otherwise = empty
iteration us iteration_no counts binds
| 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 } ;
= do {
-- Occurrence analysis
let { tagged_binds = _scc_ "OccAnal" occurAnalyseBinds binds } ;