[Git][ghc/ghc][wip/T20264] 60 commits: testsuite: Use math.inf instead of division-by-zero

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Sat Dec 28 23:04:15 UTC 2024



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


Commits:
e86b1b20 by Ben Gamari at 2024-12-17T13:51:39-05:00
testsuite: Use math.inf instead of division-by-zero

This both more directly captures the intent and also fixes #25580.

- - - - -
430d965a by Ben Gamari at 2024-12-17T13:52:15-05:00
rts: Fix incorrect format specifiers in era profiling

Fixes #25581.

- - - - -
267098ad by Andreas Klebinger at 2024-12-18T23:43:13-05:00
Document `-prof` and non `-prof` code being incompatible.

Fixes #25518.

- - - - -
04433916 by Zubin Duggal at 2024-12-18T23:43:50-05:00
ghcup metadata: output metadata fragment in CI

(cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50)

- - - - -
7c78804e by Zubin Duggal at 2024-12-18T23:43:50-05:00
ghcup metatdata: use fedora33 for redhat

Redhat 9 doesn't have libtinfo.so.5 anymore

(cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f)

- - - - -
1d72cfb2 by Zubin Duggal at 2024-12-18T23:43:50-05:00
ghcup metadata: still use centos for redhat <9

- - - - -
3f7ebc58 by Sylvain Henry at 2024-12-19T20:40:14-05:00
Merge ghc-bignum into ghc-internal (#24453)

First step towards merging ghc-bignum and ghc-prim into ghc-internal.

After this patch, ghc-bignum is deprecated and is just a shallow package
reexporting modules from ghc-internal and base. Use those directly
instead.

Move `gmp` submodule into ghc-internal directory.

- - - - -
ee0150c2 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00
Improve performance of deriving Show

Significantly improves performance of deriving Show instances by
avoiding using the very polymorphic `.` operator in favour of inlining
its definition. We were generating tons of applications of it, each
which had 3 type arguments!

Improves on #9557

-------------------------
Metric Decrease:
    InstanceMatching
    T12707
    T3294
------------------------

- - - - -
8b266671 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00
Don't eta expand cons when deriving Data

This eta expansion was introduced with the initial commit for Linear
types.

I believe this isn't needed any longer. My guess is it is an artifact
from the initial linear types implementation: data constructors are
linear, but they shouldn't need to be eta expanded to be used as higher
order functions. I suppose in the early days this wasn't true.

For instance, this works now:

    data T x = T x
    f = \(x :: forall y. y -> T y) -> x True
    f T -- ok!

T is linear, but can be passed where an unrestricted higher order
function is expected. I recall there being some magic around to make
this work for data constructors...

Since this works, there's no need to eta_expand the data constructors in
the derived Data instances.

- - - - -
1f67ad21 by Andrei Borzenkov at 2024-12-25T01:42:31-05:00
Flip the order of arguments of setField (#24668)

GHC Proposal 583 "HasField redesign" specifies the
following order of a setField function arguments as this:

  setField :: forall fld a b. SetField fld a b. b -> a -> a

This patch flips the application order to match the spec.

- - - - -
3e0c948d by Ben Gamari at 2024-12-25T01:43:08-05:00
rel-eng/upload: Add set_symlink mode

This slightly eases updating of the `latest` symlinks.

- - - - -
63d63f9d by Simon Peyton Jones at 2024-12-25T01:43:45-05:00
Preserve orientation when unifying kinds

This MR fixes yet another manifestation of the trickiness caused
by Note [Fundeps with instances, and equality orientation].

I wish there was a more robust way to do this, but this fix is
a definite improvement.

Fixes #25597

- - - - -
94ba9a6a by ARATA Mizuki at 2024-12-26T10:47:57-05:00
x86 NCG SIMD: Support pack/insert/broadcast/unpack of 128-bit integer vectors

- - - - -
6bf0d587 by Andrew Lelechenko at 2024-12-26T10:48:33-05:00
docs: fix haddock formatting in Control.Monad.Fix

- - - - -
feb14af1 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00
Remove unnecessary irrefutable patterns from NonEmpty functions

Implementation of https://github.com/haskell/core-libraries-committee/issues/107

- - - - -
6a0d91b4 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00
Make cons, Semigroup, IsList, and Monad instances stricter

- - - - -
1249e597 by Sergey Vinokurov at 2024-12-27T15:06:28+00:00
Restore some laziness in <| and Semigroup instance, improve Monad instance

The Monad instance shouldn't produce the outer :| unless f a reduces
to WHNF. (Notice that the b :| bs match is implicitly lazy.)

- - - - -
8699d826 by Sergey Vinokurov at 2024-12-27T15:12:30+00:00
Add comment outlining Data.List.NonEmpty implementation guiding principles

- - - - -
7febe00e by Sergey Vinokurov at 2024-12-27T22:24:43+00:00
Fix tests since location of ‘>>=’ changed

- - - - -
a928c326 by ARATA Mizuki at 2024-12-28T03:06:14-05:00
Fix LLVM version detection

With a recent LLVM, `llc -version` emits the version on the first line
if the vendor is set.  It emits the version on the second line
otherwise.

Therefore, we need to check the both lines to detect the version.

GHC now emits a warning if it fails to detect the LLVM version,
so we can notice if the output of `llc -version` changes in the future.

Also, the warning for using LLVM < 10 on s390x is removed, because
we assume LLVM >= 13 now.

This fixes the definition of __GLASGOW_HASKELL_LLVM__ macro.

Fixes #25606

- - - - -
c7b26d74 by Joseph Fourment at 2024-12-28T22:18:06+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.

- - - - -
c2c6e3f8 by Joseph Fourment at 2024-12-28T22:18:06+00:00
simple-opt: don't inline type-lets

- - - - -
31c544b9 by Joseph Fourment at 2024-12-28T22:18:06+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.

- - - - -
e3f5cd5c by Joseph Fourment at 2024-12-28T22:18:06+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.

- - - - -
2340c43b by Joseph Fourment at 2024-12-28T22:18:06+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.

- - - - -
3200eaf2 by Joseph Fourment at 2024-12-28T22:18:06+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.

- - - - -
c302b2ae by Joseph Fourment at 2024-12-28T22:18:06+00:00
simple-opt: fix simple_type_bind

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

- - - - -
73fdd04c by Joseph Fourment at 2024-12-28T22:18:07+00:00
simple-opt: make beta-reduction use simple_bind_type

- - - - -
93b02de1 by Joseph Fourment at 2024-12-28T22:18:07+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.

- - - - -
8d350041 by Joseph Fourment at 2024-12-28T22:18:07+00:00
dmd-anal: prefix unused variable with _ to avoid warning

- - - - -
f61a08d7 by Joseph Fourment at 2024-12-28T22:18:07+00:00
type: inline unfoldView in sORTKind_maybe

- - - - -
bf3aadab by Joseph Fourment at 2024-12-28T22:18:07+00:00
tidy: deal with type-lets

- - - - -
83821c68 by Joseph Fourment at 2024-12-28T22:18:07+00:00
notes: add Note [Type and coercion lets]

- - - - -
1b8fa366 by Joseph Fourment at 2024-12-28T22:18:07+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.

- - - - -
2ae60e32 by Joseph Fourment at 2024-12-28T22:18:07+00:00
simplifier: inline single-occurring type-lets

- - - - -
c36856f6 by Joseph Fourment at 2024-12-28T22:18:07+00:00
cleanup: remove NOINLINE on tyVarOccInfo

- - - - -
c07a4b4f by Simon Peyton Jones at 2024-12-28T22:18:07+00:00
Wibbles

- - - - -
3e5e7c08 by Simon Peyton Jones at 2024-12-28T22:18:07+00:00
Wibbles

- - - - -
2617053e by Simon Peyton Jones at 2024-12-28T22:18:07+00:00
Progress

- - - - -
d6e4b39f by Simon Peyton Jones at 2024-12-28T22:18:07+00:00
Progress

- - - - -
e197c708 by Simon Peyton Jones at 2024-12-28T22:18:07+00:00
More progress

- - - - -
4f6080ac by Simon Peyton Jones at 2024-12-28T22:18:07+00:00
Progress

...doesn't compile though

- - - - -
4766c3a2 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Mostly working now

- - - - -
8c8014ca by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Aggressively create type-lets

- - - - -
d13ed73d by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
more progress

- - - - -
2379f72a by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
More progress

- - - - -
0ca7ef01 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Temp debug printing

- - - - -
95c5ad08 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Remove bogus assert

- - - - -
4e5361f4 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Fix anoher couple of bugs

in SimpleOpt and exprIsTrivial

- - - - -
b411e8e7 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Improve zonking of foreign decls to avoid TcTyVars escaping

- - - - -
97f15ef9 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Wibbles

- - - - -
a666d5b5 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Some small wibbles

- - - - -
0f226494 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Improvements

- - - - -
c22a4d47 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Rmmove trace

- - - - -
8a67a8b2 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Wibbles

- - - - -
938da74e by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Use lambda, not let, in WorkWrap

Using type let did not work right with type lets and shadowing

Requires Lint to be OK join points under beta redexes -- but it is!

Needs better documentation

- - - - -
9c3d5516 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
Wibbles

- - - - -
8a27e1ec by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
More improvements

- - - - -
4a4015c3 by Simon Peyton Jones at 2024-12-28T22:18:08+00:00
More improvements

* Less cloning in SpecConstr
* Lint checks RULES for imported binders

- - - - -
4f993850 by Simon Peyton Jones at 2024-12-28T23:03:42+00:00
Comments only

- - - - -


25 changed files:

- .gitlab-ci.yml
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- .gitlab/rel_eng/upload.sh
- .gitmodules
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToLlvm.hs
- 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/Exitify.hs
- compiler/GHC/Core/Opt/FloatIn.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Env.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/818eeaa30f6894e2d67692198d39900d351b0ff5...4f993850219fcabda07914116bff2e32d02499fd

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/818eeaa30f6894e2d67692198d39900d351b0ff5...4f993850219fcabda07914116bff2e32d02499fd
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/20241228/a9336fe6/attachment-0001.html>


More information about the ghc-commits mailing list