[project @ 2001-09-07 12:42:46 by simonpj]
authorsimonpj <unknown>
Fri, 7 Sep 2001 12:42:47 +0000 (12:42 +0000)
committersimonpj <unknown>
Fri, 7 Sep 2001 12:42:47 +0000 (12:42 +0000)
commitd3f613149e033256620ef26e713d67a0f896f0df
treee3b79573d7a382c762182c6526d5deabf1198891
parent3446ed6c394f83a8e1a9e95c1a6712c21031ea90
[project @ 2001-09-07 12:42:46 by simonpj]
------------------------
Fix the demand analyser
------------------------

A spiffy new domain for demands, and definitions for lub/both
which are actually monotonic.   Quite a bit of related jiggling
around.

One of the original motivations was to do with functions like:

sum n []     = n
sum n (x:xs) = sum (n+x) xs

Even though n is returned boxed from the first case, we don't want
to get strictness
S(L)V -> T
because that means we pass the box for n, and that is TERRIBLE.
So the new version errs on the side of unboxing, more like the forwards
analyser, and only passes the box if it is *definitely* needed, rather
than if it *may* be needed.
ghc/compiler/basicTypes/IdInfo.lhs
ghc/compiler/basicTypes/NewDemand.lhs
ghc/compiler/parser/Lex.lhs
ghc/compiler/stranal/DmdAnal.lhs
ghc/compiler/stranal/WorkWrap.lhs
ghc/compiler/stranal/WwLib.lhs