Fix a long-standing bug in the demand analyser
authorSimon Peyton Jones <simonpj@microsoft.com>
Mon, 6 Apr 2015 13:10:52 +0000 (14:10 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Tue, 7 Apr 2015 14:10:17 +0000 (15:10 +0100)
commit9f0f99fd41ff82cc223d3b682703e508efb564d2
tree5936659004f5f09823a57c2c7e9042f47c24aa6b
parentb972de0365f94e1be9d78537152eee969dc5f4cb
Fix a long-standing bug in the demand analyser

This patch fixes Trac #10148, an outright and egregious
bug in the demand analyser.

It is explained in Note [Demand on case-alternative binders]
in Demand.hs.

I did some other minor refactoring.

To my astonishment I got some big compiler perf changes

* perf/compiler/T5837: bytes allocated -76%
* perf/compiler/T5030: bytes allocated -10%
* perf/compiler/T3294: max bytes used  -25%

Happy days
compiler/basicTypes/Demand.hs
compiler/stranal/DmdAnal.hs