[Git][ghc/ghc][wip/backports-9.6] 2 commits: Handle shadowing in DmdAnal (#22718)

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Jan 18 17:31:29 UTC 2023



Ben Gamari pushed to branch wip/backports-9.6 at Glasgow Haskell Compiler / GHC


Commits:
a886fcc8 by Sebastian Graf at 2023-01-18T12:30:25-05:00
Handle shadowing in DmdAnal (#22718)

Previously, when we had a shadowing situation like
```hs
f x = ... -- demand signature <1L><1L>

main = ... \f -> f 1 ...
```
we'd happily use the shadowed demand signature at the call site inside the
lambda. Of course, that's wrong and solution is simply to remove the demand
signature from the `AnalEnv` when we enter the lambda.
This patch does so for all binding constructs Core.

In #22718 the issue was caused by LetUp not shadowing away the existing demand
signature for the let binder in the let body. The resulting absent error is
fickle to reproduce; hence no reproduction test case. #17478 would help.

Fixes #22718.

It appears that TcPlugin_Rewrite regresses by ~40% on Darwin. It is likely that
DmdAnal was exploiting ill-scoped analysis results.

Metric increase ['bytes allocated'] (test_env=x86_64-darwin-validate):
    TcPlugin_Rewrite

(cherry picked from commit e3fff7512bbf989386faaa1dccafdad1deabde84)

- - - - -
991b9ca5 by Ben Gamari at 2023-01-18T12:31:21-05:00
Accept performance metric changes

Metric Decrease:
    MultiLayerModulesTH_OneShot
    T21839c
    T21839r

- - - - -


0 changed files:



Changes:


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/76738aeb65182562184c4d406e66b6665efe26e4...991b9ca567389114e8bfd7bd9c5483a1602b2427

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/76738aeb65182562184c4d406e66b6665efe26e4...991b9ca567389114e8bfd7bd9c5483a1602b2427
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230118/bcf1c14e/attachment.html>


More information about the ghc-commits mailing list