Stamp out space leaks from demand analysis

Authored by rwbarton on Mar 30 2017, 2:26 PM.



This reduces peak memory usage by ~30% on my test case (DynFlags),
and (probably as a result of reduced GC work) decreases compilation
time by a few percent as well.

Also fix a bug in seqStrDmd so that demeand info is fully evaluated.

Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
rwbarton created this revision.Mar 30 2017, 2:26 PM
dfeuer added a subscriber: dfeuer.Mar 30 2017, 6:46 PM

I'd personally be much happier if we found a way to get it right the first time, probably by making the AST stricter. Have you looked into whether we can do so safely?

Nope, but feel free. I wasn't looking to get involved with major structural changes to these complicated modules (Demand and DmdAnal). If all the *Dmd types can be made fully strict without causing a significant increase in work then that would be an improvement.

This change is easy and has a large impact.

bgamari accepted this revision.Apr 1 2017, 10:19 AM

Sounds good to me.

This revision is now accepted and ready to land.Apr 1 2017, 10:19 AM
This revision was automatically updated to reflect the committed changes.