diff options
author | simonpj@microsoft.com <unknown> | 2007-08-05 22:03:35 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2007-08-05 22:03:35 +0000 |
commit | 57a4597d5a487af65d0a6c9a6701e2efcbbefac2 (patch) | |
tree | 483f3eb96e2082db89ac1b0687ed69487c0c86c9 /compiler/codeGen | |
parent | 0b34654125ca8551a1ce82919236d67a862b59bd (diff) | |
download | haskell-57a4597d5a487af65d0a6c9a6701e2efcbbefac2.tar.gz |
Make SpecConstr specialise for constant arguments again
Consider
lvl = Just True
foo :: Maybe Bool -> Int -> Int
foo (Just True) i = i
foo _ i = foo lvl i
SpecConstr should specialise foo, but it wasn't doing so (spotted
by Roman).
Reason: lvl's unfolding wasn't in the cloned version of lvl.
Solution: extend the value environment to record top-level bindings too
At the same time I made it work if 'lvl' is a lambda, in which case it
is again worth specialisg. This meant renaming ConEnv to ValueEnv,
and adding a case for 'LambdaVal'.
(To make specialisation on lambdas work properly, we have to do lambda
lifting as well, but this gets part of the way, and fixes a bug too.)
Diffstat (limited to 'compiler/codeGen')
0 files changed, 0 insertions, 0 deletions