[Git][ghc/ghc][wip/T20264] 37 commits: Add since tag for -fwrite-if-compression in user guide.

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Sat Nov 2 00:41:52 UTC 2024



Simon Peyton Jones pushed to branch wip/T20264 at Glasgow Haskell Compiler / GHC


Commits:
1d7cd7fe by Andreas Klebinger at 2024-10-30T19:14:28-04:00
Add since tag for -fwrite-if-compression in user guide.

Partial fix for #25395

- - - - -
b349fd1b by Alan Zimmerman at 2024-10-30T19:15:04-04:00
EPA: Remove some unused functions

- - - - -
f859d61c by Alan Zimmerman at 2024-10-30T19:15:04-04:00
EPA: use explicit vertical bar token for ExplicitSum / SumPat

- - - - -
721ac00d by Ben Gamari at 2024-10-31T08:37:38-04:00
rts/Disassembler: Fix encoding of BRK_FUN instruction

The offset of the CC field was not updated after the encoding change in
b85b11994e0130ff2401dd4bbdf52330e0bcf776. Fix this.

Fixes #25374.

- - - - -
0bc94360 by Alan Zimmerman at 2024-10-31T08:38:15-04:00
EPA: Bring in last EpToken usages

For import declarations, NameAnnCommas and NPlusKPat.

And remove anchor, it is the same as epaLocationRealSrcSpan.

- - - - -
0b11cdc0 by sheaf at 2024-10-31T08:38:55-04:00
Assert that ctEvCoercion is called on an equality

Calling 'ctEvCoercion' on non-equality constraints is always incorrect.
We add an assertion to this function to detect such cases; for example
a type-checking plugin might erroneously do this.

- - - - -
ea458779 by doyougnu at 2024-11-01T18:11:33-04:00
ghc-internal: strict, unboxed src loc ranges

- closes: #20449
- See CLC proposal: #55

- - - - -
778ac793 by Kazuki Okamoto at 2024-11-01T18:12:13-04:00
No haddock markup in doctest line

- - - - -
7f5ed9a2 by Joseph Fourment at 2024-11-01T22:41:14+00:00
compiler: introduce type variable unfoldings

The plan for #20264 is to introduce let-bound types to have observable sharing in types.
To avoid the need to carry an environment when dealing with occurrences of these type variables,
we embed the types they're bound to (if any) in a `tv_unfolding :: Maybe Type` attribute.
This way, one can look through let-bound type variables using `coreView` and friends.
In particular, definitional equality looks through unfoldings.

- - - - -
21bf6d45 by Joseph Fourment at 2024-11-01T22:41:15+00:00
simple-opt: don't inline type-lets

- - - - -
9cd37f39 by Joseph Fourment at 2024-11-01T22:41:15+00:00
specialise: fix type-lets in DFun unfoldings

During specialisation, a dictionary being specialised gets a new unfolding by turning
`DFun \ bndrs      -> MkD @<T1> ... @<Tm> <op1> ... <opn>` into
`DFun \ spec_bndrs -> MkD @((\ bndrs -> TYPE: <T1>) spec_args) ... ((\ bndrs -> <opn>) spec_args)`
which in turns gets beta-reduced into
`DFun \ spec_bndrs -> MkD (let { bndrs = spec_args } in TYPE: <T1>) ... (let { bndrs = spec_args } in <opn>)`.
Previously, such let binders would immediately be substituted into the type so it didn't cause any issue,
but now we want to avoid inlining.
Arguments of the form `let { bndrs = spec_args } in TYPE: <T1>` are not considered as type arguments since they're
not of the canonical form `TYPE: something`.
This commit restores the previous behavior of substituting the specialised type arguments.
Alternatively, we could attach some floated type bindings to `DFun`s.

- - - - -
512fd81a by Joseph Fourment at 2024-11-01T22:41:15+00:00
occur-anal: implement occurence analysis for type variables

In order to find out let-bound type variables that are used only once, in the hope of inlining them,
we need to track type variables as well in the occurrence analiser. Just like Id's, we attach an
`OccInfo` to each (immutable) type variable, and we walk into types and coercions to accurately gather
occurrences.

- - - - -
3443b58b by Joseph Fourment at 2024-11-01T22:41:15+00:00
simplifier: don't inline type-lets

Keep propagating type-lets further down the pipeline, in the simplifier.
We also update CallArity, CprAnal, DmdAnal, WorkWrap, and Specialise to ignore type-lets.

- - - - -
55e30c6d by Joseph Fourment at 2024-11-01T22:41:15+00:00
prep: make type-lets pass through CorePrep

As a first attempt, ignore type-lets in CorePrep to avoid crashes.
However, this is not enough: CorePrep also does some let-floating.
If we don't float type-lets along with value-level let-bindings,
the latter can float out of the scope of a type variable in use.

- - - - -
a5ce5fb2 by Joseph Fourment at 2024-11-01T22:41:15+00:00
simple-opt: fix simple_type_bind

Also:
- Inline small types using a new typeIsSmallEnoughToInline predicate
- Inline single-occurrence variables

- - - - -
ec362740 by Joseph Fourment at 2024-11-01T22:41:15+00:00
simple-opt: make beta-reduction use simple_bind_type

- - - - -
f3320983 by Joseph Fourment at 2024-11-01T22:41:15+00:00
iface: add IfaceTypeLetBndr to represent non-top-level type-let binders

IfaceLetBndr isn't fit to represent type-let binders, as it includes a
bunch of vacuous flags for Ids only.
Instead of putting squares in circles, I added a new constructor for type binders.

The downside is that it breaks existing iface files, so since we can't bootstrap
yet so we have to bootstrap a cherry-picked branch and then checkout again to build
with --freeze1.

To avoid similar issues in the future, IfaceTyVarInfoItem serialises with a tag
despite there being only one constructor for now.

- - - - -
54ec5375 by Joseph Fourment at 2024-11-01T22:41:15+00:00
dmd-anal: prefix unused variable with _ to avoid warning

- - - - -
56e971de by Joseph Fourment at 2024-11-01T22:41:16+00:00
type: inline unfoldView in sORTKind_maybe

- - - - -
ea9c8a46 by Joseph Fourment at 2024-11-01T22:41:16+00:00
tidy: deal with type-lets

- - - - -
738e1af2 by Joseph Fourment at 2024-11-01T22:41:16+00:00
notes: add Note [Type and coercion lets]

- - - - -
bae3bfb3 by Joseph Fourment at 2024-11-01T22:41:16+00:00
notes: update Note [Comparing nullary type synonyms] to account for type variables

While updating backlinks, I noticed the optimisation for type variables
could be performed in more places.

- - - - -
adb12493 by Joseph Fourment at 2024-11-01T22:41:16+00:00
simplifier: inline single-occurring type-lets

- - - - -
c3219340 by Joseph Fourment at 2024-11-01T22:41:16+00:00
cleanup: remove NOINLINE on tyVarOccInfo

- - - - -
713525b2 by Simon Peyton Jones at 2024-11-01T22:41:16+00:00
Wibbles

- - - - -
5784433e by Simon Peyton Jones at 2024-11-01T22:41:16+00:00
Wibbles

- - - - -
87078bcf by Simon Peyton Jones at 2024-11-01T22:41:17+00:00
Progress

- - - - -
523acbd9 by Simon Peyton Jones at 2024-11-01T22:42:11+00:00
Progress

- - - - -
cf1a07ad by Simon Peyton Jones at 2024-11-01T22:42:11+00:00
More progress

- - - - -
31450e83 by Simon Peyton Jones at 2024-11-01T22:42:11+00:00
Progress

...doesn't compile though

- - - - -
e319b35c by Simon Peyton Jones at 2024-11-01T22:42:12+00:00
Mostly working now

- - - - -
866f26c6 by Simon Peyton Jones at 2024-11-01T22:42:12+00:00
Aggressively create type-lets

- - - - -
6b12c575 by Simon Peyton Jones at 2024-11-01T22:42:12+00:00
more progress

- - - - -
a2ecf8a6 by Simon Peyton Jones at 2024-11-01T22:42:12+00:00
More progress

- - - - -
12739b78 by Simon Peyton Jones at 2024-11-01T22:42:12+00:00
Temp debug printing

- - - - -
1f95d353 by Simon Peyton Jones at 2024-11-02T00:40:27+00:00
Remove bogus assert

- - - - -
9be15075 by Simon Peyton Jones at 2024-11-02T00:40:40+00:00
Fix anoher couple of bugs

in SimpleOpt and exprIsTrivial

- - - - -


30 changed files:

- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/CallArity.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/FloatIn.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Seq.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/Tidy.hs
- compiler/GHC/Core/TyCo/Compare.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Ppr.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ab348029e635aef41670ea094cc4ba11f47fd30...9be15075b0a7ad745861b3f2bd7551dad6efce3e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ab348029e635aef41670ea094cc4ba11f47fd30...9be15075b0a7ad745861b3f2bd7551dad6efce3e
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/20241101/9f92387b/attachment-0001.html>


More information about the ghc-commits mailing list