[Git][ghc/ghc][wip/codebuffer-perftest] 4 commits: DmdAnal: Unleash demand signatures of free RULE and unfolding binders (#23208)

Josh Meredith (@JoshMeredith) gitlab at gitlab.haskell.org
Thu Apr 27 16:03:13 UTC 2023



Josh Meredith pushed to branch wip/codebuffer-perftest at Glasgow Haskell Compiler / GHC


Commits:
c30ac25f by Sebastian Graf at 2023-04-26T14:50:51-04:00
DmdAnal: Unleash demand signatures of free RULE and unfolding binders (#23208)

In #23208 we observed that the demand signature of a binder occuring in a RULE
wasn't unleashed, leading to a transitively used binder being discarded as
absent. The solution was to use the same code path that we already use for
handling exported bindings.

See the changes to `Note [Absence analysis for stable unfoldings and RULES]`
for more details.

I took the chance to factor out the old notion of a `PlusDmdArg` (a pair of a
`VarEnv Demand` and a `Divergence`) into `DmdEnv`, which fits nicely into our
existing framework. As a result, I had to touch quite a few places in the code.

This refactoring exposed a few small bugs around correct handling of bottoming
demand environments. As a result, some strictness signatures now mention uniques
that weren't there before which caused test output changes to T13143, T19969 and
T22112. But these tests compared whole -ddump-simpl listings which is a very
fragile thing to begin with. I changed what exactly they test for based on the
symptoms in the corresponding issues.

There is a single regression in T18894 because we are more conservative around
stable unfoldings now. Unfortunately it is not easily fixed; let's wait until
there is a concrete motivation before invest more time.

Fixes #23208.

- - - - -
77f506b8 by Josh Meredith at 2023-04-26T14:51:28-04:00
Refactor GenStgRhs to include the Type in both constructors (#23280, #22576, #22364)

Carry the actual type of an expression through the PreStgRhs and into GenStgRhs
for use in later stages. Currently this is used in the JavaScript backend to fix
some tests from the above mentioned issues: EtaExpandLevPoly, RepPolyWrappedVar2,
T13822, T14749.

- - - - -
052e2bb6 by Alan Zimmerman at 2023-04-26T14:52:05-04:00
EPA: Use ExplicitBraces only in HsModule

!9018 brought in exact print annotations in LayoutInfo for open and
close braces at the top level.

But it retained them in the HsModule annotations too.

Remove the originals, so exact printing uses LayoutInfo

- - - - -
06ac7bda by Josh Meredith at 2023-04-27T16:02:52+00:00
base/encoding: add an allocations performance test (#22946)

- - - - -


30 changed files:

- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/CoreToStg.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Parser.y
- compiler/GHC/Stg/BcPrep.hs
- compiler/GHC/Stg/CSE.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/Stg/FVs.hs
- compiler/GHC/Stg/InferTags.hs
- compiler/GHC/Stg/InferTags/Rewrite.hs
- compiler/GHC/Stg/Lift.hs
- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Stg/Lift/Monad.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/Stg/Stats.hs
- compiler/GHC/Stg/Syntax.hs
- compiler/GHC/Stg/Unarise.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToJS/CodeGen.hs
- compiler/GHC/StgToJS/Expr.hs
- compiler/GHC/StgToJS/Sinker.hs
- compiler/GHC/StgToJS/StgUtils.hs
- compiler/GHC/Types/Demand.hs
- libraries/base/tests/perf/all.T


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9ec71b2ad6545d033348e4e0a04e27bc8eaba72a...06ac7bdaa27948fc08f6ea2df08ef50c23fb46c5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/9ec71b2ad6545d033348e4e0a04e27bc8eaba72a...06ac7bdaa27948fc08f6ea2df08ef50c23fb46c5
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/20230427/4c9cb01f/attachment.html>


More information about the ghc-commits mailing list