[Git][ghc/ghc][wip/backports-9.4] 38 commits: Bump hadrian index state to allow 9.4 as boot compiler

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Thu Dec 22 22:10:35 UTC 2022



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


Commits:
79a09016 by Andreas Klebinger at 2022-11-10T13:14:04+01:00
Bump hadrian index state to allow 9.4 as boot compiler

- - - - -
36a2eebf by Andreas Klebinger at 2022-11-10T13:32:16+01:00
Add -dsuppress-coercion-types to make coercions even smaller.

Instead of `` `cast` <Co:11> :: (Some -> Really -> Large Type)``
simply print `` `cast` <Co:11> :: ... ``

- - - - -
81cae7b7 by Andreas Klebinger at 2022-11-21T14:35:08+01:00
Fix #22425 - Broken eta-expansion over expensive work.

Through a mistake in the latest backport we started eta-expanding over
expensive work by mistake. E.g. over <expensive> in code like:

  case x of
    A -> id
    B -> <expensive>

We fix this by only eta-expanding over <expensive> if all other branches
are headed by an oneShot lambda.

In the long story of broken eta-expansion on 9.2/9.4 this is hopefully
the last chapter.

-------------------------
Metric Increase:
    CoOpt_Read
    T1969
    parsing001
    TcPlugin_RewritePerf
    LargeRecord
-------------------------

- - - - -
51c6051b by Matthew Pickering at 2022-12-13T09:30:47+00:00
ApplicativeDo: Set pattern location before running exhaustiveness checker

This improves the error messages of the exhaustiveness checker when
checking statements which have been moved around with ApplicativeDo.

Before:

Test.hs:2:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘Maybe ()’ not matched: Nothing
  |
2 |   let x = ()
  |   ^^^^^^^^^^

After:

Test.hs:4:3: warning: [GHC-62161] [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding:
        Patterns of type ‘Maybe ()’ not matched: Nothing
  |
4 |   ~(Just res1) <- seq x (pure $ Nothing @())
  |

Fixes #22483

(cherry picked from commit 74c767df770766d8d52e87b9ff7da10f94620a91)

- - - - -
13040bf0 by Matthew Pickering at 2022-12-13T09:30:47+00:00
Typeable: Fix module locations of some definitions in GHC.Types

There was some confusion in Data.Typeable about which module certain
wired-in things were defined in. Just because something is wired-in
doesn't mean it comes from GHC.Prim, in particular things like LiftedRep
and RuntimeRep are defined in GHC.Types and that's the end of the story.

Things like Int#, Float# etc are defined in GHC.Prim as they have no
Haskell definition site at all so we need to generate type
representations for them (which live in GHC.Types).

Fixes #22510

(cherry picked from commit 1d3a8b8ec98e6eedf8943e19780ec374c2491e7f)

- - - - -
127dcc49 by Ian-Woo Kim at 2022-12-13T09:30:47+00:00
Truncate eventlog event for large payload (#20221)

RTS eventlog events for postCapsetVecEvent are truncated if payload
is larger than EVENT_PAYLOAD_SIZE_MAX
Previously, postCapsetVecEvent records eventlog event with payload
of variable size larger than EVENT_PAYLOAD_SIZE_MAX (2^16) without
any validation, resulting in corrupted data.
For example, this happens when a Haskell binary is invoked with very
long command line arguments exceeding 2^16 bytes (see #20221).
Now we check the size of accumulated payload messages incrementally,
and truncate the message just before the payload size exceeds
EVENT_PAYLOAD_SIZE_MAX. RTS will warn the user with a message showing
how many arguments are truncated.

(cherry picked from commit 2057c77d08cb8422857d182a3691f98dccd0c7d6)

- - - - -
f84d7562 by Simon Peyton Jones at 2022-12-13T09:30:47+00:00
Add a missing varToCoreExpr in etaBodyForJoinPoint

This subtle bug showed up when compiling a library with 9.4.
See #22491.  The bug is present in master, but it is hard to
trigger; the new regression test T22491 fails in 9.4.

The fix was easy: just add a missing varToCoreExpr in
etaBodyForJoinPoint.

The fix is definitely right though!

(cherry picked from commit afc2540daf6ca6baa09ab147b792da08d66d878c)

- - - - -
8c85afe3 by sheaf at 2022-12-13T09:30:47+00:00
Fix @since annotations on WithDict and Coercible

Fixes #22453

(cherry picked from commit 68c966cd3c9d581bac4573807e433fe8d063445f)

- - - - -
7fbcb2c6 by Ben Gamari at 2022-12-13T09:30:47+00:00
eventlog: Ensure that IPE output contains actual info table pointers

The refactoring in 866c736e introduced a rather subtle change in the
semantics of the IPE eventlog output, changing the eventlog field from
encoding info table pointers to "TNTC pointers" (which point to entry
code when tables-next-to-code is enabled). Fix this.

Fixes #22452.

(cherry picked from commit 268a3ce952f6be00a1dd164dc4d7acb346045e90)

- - - - -
ea7fb64d by Matthew Pickering at 2022-12-13T09:30:47+00:00
driver: Fix -fdefer-diagnostics flag

The `withDeferredDiagnostics` wrapper wasn't doing anything because the
session it was modifying wasn't used in hsc_env. Therefore the fix is
simple, just push the `getSession` call into the scope of
`withDeferredDiagnostics`.

Fixes #22391

(cherry picked from commit 6dab0046b575e102bf3245fd63d5ac6bc6f4204d)

- - - - -
5912ca80 by Ben Gamari at 2022-12-13T09:30:47+00:00
Fix manifest filename when writing Windows .rc files

As noted in #12971, we previously used `show` which resulted in
inappropriate escaping of non-ASCII characters.

(cherry picked from commit a4dbd102af1989526ca87f4dd949f72231284e68)

- - - - -
f34261f3 by Ben Gamari at 2022-12-13T09:30:47+00:00
Write response files in UTF-8 on Windows

This reverts the workaround introduced in
f63c8ef33ec9666688163abe4ccf2d6c0428a7e7, which taught our response file
logic to write response files with the `latin1` encoding to workaround
`gcc`'s lacking Unicode support. This is now no longer necessary (and in
fact actively unhelpful) since we rather use Clang.

(cherry picked from commit 30f0d9a9ded55a822e094847d5ac8087262fb8da)

- - - - -
3e648642 by Andreas Klebinger at 2022-12-13T09:30:47+00:00
Properly cast values when writing/reading unboxed sums.

Unboxed sums might store a Int8# value as Int64#. This patch
makes sure we keep track of the actual value type.

See Note [Casting slot arguments] for the details.

(cherry picked from commit 31462d98c31e3ef48af2f6c6f2d379d74ccc63f5)

- - - - -
7a40261f by Dai at 2022-12-13T09:30:47+00:00
Add VecSlot for unboxed sums of SIMD vectors

This patch adds the missing `VecRep` case to `primRepSlot` function and
all the necessary machinery to carry this new `VecSlot` through code
generation. This allows programs involving unboxed sums of SIMD vectors
to be written and compiled.

Fixes #22187

(cherry picked from commit 5b3a992f5d166007c3c5a22f120ed08e0a27f01a)

- - - - -
19d7a5fc by sheaf at 2022-12-13T09:30:47+00:00
Remove SIMD conversions

This patch makes it so that packing/unpacking SIMD
vectors always uses the right sized types, e.g.
unpacking a Word16X4# will give a tuple of Word16#s.

As a result, we can get rid of the conversion instructions
that were previously required.

Fixes #22296

(cherry picked from commit 6d7d91817795d7ee7f45557411368a1738daa488)

- - - - -
2e778abc by sheaf at 2022-12-13T09:30:48+00:00
Cmm Lint: relax SIMD register assignment check

As noted in #22297, SIMD vector registers can be used
to store different kinds of values, e.g. xmm1 can be used
both to store integer and floating point values.
The Cmm type system doesn't properly account for this, so
we weaken the Cmm register assignment lint check to only
compare widths when comparing a vector type with its
allocated vector register.

(cherry picked from commit 3be48877e204fca8e5d5ab984186e0d20d81f262)

- - - - -
052dc022 by sheaf at 2022-12-13T09:30:48+00:00
Disable some SIMD tests on non-X86 architectures

(cherry picked from commit f7b7a3122185222d5059e37315991afcf319e43c)

- - - - -
3cc20a1a by Andreas Klebinger at 2022-12-13T09:30:48+00:00
Improve stg lint for unboxed sums.

It now properly lints cases where sums end up distributed
over multiple args after unarise.

Fixes #22026.

(cherry picked from commit 8d2dbe2db4cc7c8b6d39b1ea64b0508304a3273c)

- - - - -
fcce6b7e by Simon Peyton Jones at 2022-12-13T09:30:48+00:00
Fix a trivial typo in dataConNonlinearType

Fixes #22416

(cherry picked from commit 294f907370fadd3313f8c5e6aa87a93c8b86f139)

- - - - -
c43e5681 by Gabriella Gonzalez at 2022-12-13T09:30:48+00:00
Serialize builds of `rts` and `system-cxx-std-lib`

Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/22099

I cannot say for sure that this will fix the linked issue, but
I explained why I believe this fixes the root problem in:

https://gitlab.haskell.org/ghc/ghc/-/issues/22099#note_461386

… and when we applied this patch internally the problem appeared to
disappear for a few builds in a row with a large number of cores.

The short summary of the above comment is that the `Makefile`
serializes the package registrations using `ghc-pkgs`, with the
exception of two packages (`rts` and `system-cxx-std-lib`) and
we expect that this one instance of parallelism that was still
left in the `Makefile` was the root cause of the flaky build
failure.

This fix would be consistent with two known things about the
failure:

- The build failure only occurs for parallel `Make` builds

  … and these are the only two `ghc-pkg` calls that run concurrently

- The error first appeared in the GHC 9.4 branch and was absent in GHC 9.2

  … and GHC 9.4 was the first release that included `system-cxx-std-lib`
  (as far as I know), which would explain why this problem
  didn't happen before.

The change here forces the two packages to be registered in
sequence.

This problem will of course go away in GHC 9.6 by virtue of
dropping the `make`-based build, but since the GHC 9.4 branch is
supported and active we wanted to upstream this patch to the
9.4 development branch.

- - - - -
5e9ac694 by Matthew Pickering at 2022-12-14T16:19:58+00:00
Package Imports: Get candidate packages also from re-exported modules

Previously we were just looking at the direct imports to try and work
out what a package qualifier could apply to but #22333 pointed out we
also needed to look for reexported modules.

Fixes #22333

(cherry picked from commit 58a138d0f62c057333e4fd15fe20df64492b1dac)

- - - - -
59a296f6 by Ben Gamari at 2022-12-15T09:38:30+00:00
compiler: Ensure that MutVar operations have necessary barriers

Here we add acquire and release barriers in readMutVar# and
writeMutVar#, which are necessary for soundness.

Fixes #22468.

(cherry picked from commit a9834736a90aefdd32cfc15be507e22b57eedc07)

- - - - -
b66638f4 by Ben Gamari at 2022-12-15T09:40:57+00:00
Bump Win32 submodule to v2.12.0.1

Addresses #20017 for 9.4.4.

(cherry picked from commit 0f63c830abf0778c5b6c073d36dc6377844aa087)

- - - - -
5c75888e by Sebastian Graf at 2022-12-15T09:48:34+00:00
Do not strictify a DFun's parameter dictionaries (#22549)

... thus fixing #22549.

The details are in the refurbished and no longer dead
`Note [Do not strictify a DFun's parameter dictionaries]`.

There's a regression test in T22549.

(cherry picked from commit 26e71562072f6740d52fcd38298340c287a641b8)

- - - - -
aa422c71 by Ben Gamari at 2022-12-15T09:50:32+00:00
cmm: Introduce blockConcat

(cherry picked from commit da7b51d8598400ed8073afe1b311c73a04e2230d)

- - - - -
54ad2942 by Ben Gamari at 2022-12-15T09:50:45+00:00
cmm: Introduce MemoryOrderings

(cherry picked from commit 34f6b09c8e985017c4b18896aeac0c20baf4433d)

- - - - -
22e5cfe6 by Ben Gamari at 2022-12-15T09:50:46+00:00
llvm: Respect memory specified orderings

(cherry picked from commit 43beaa7baf02d75946c37974fbe46d2857920a53)

- - - - -
6afffee5 by Ben Gamari at 2022-12-15T09:50:46+00:00
Codegen/x86: Eliminate barrier for relaxed accesses

(cherry picked from commit 8faf74fcbd9d9da81ce8a901d694711c5d7ad406)

- - - - -
61798773 by Ben Gamari at 2022-12-15T09:50:46+00:00
cmm/Parser: Reduce some repetition

(cherry picked from commit 6cc3944a06cc5be302bb023a43c0537838b50861)

- - - - -
3208e037 by Ben Gamari at 2022-12-15T09:50:46+00:00
cmm/Parser: Add syntax for ordered loads and stores

(cherry picked from commit 6c9862c4fee395345dbbcd8ad58ae3f08753219e)

- - - - -
32497a14 by Ben Gamari at 2022-12-15T09:50:46+00:00
cmm/Parser: Atomic load syntax

Originally I had thought I would just use the `prim` call syntax instead
of introducing new syntax for atomic loads. However, it turns out that
`prim` call syntax tends to make things quite unreadable. This new
syntax seems quite natural.

(cherry picked from commit 748490d2ff51d6c6fa44aad587908b271c801fa9)

- - - - -
bb4d238b by Ben Gamari at 2022-12-15T09:52:43+00:00
rts: Ensure that global regs are never passed as fun call args

This is in general unsafe as they may be clobbered if they are mapped to
caller-saved machine registers. See Note [Register parameter passing].

(cherry picked from commit 9372329008143104b0ae5e8e792e957090dfa743)

- - - - -
f9ce32c8 by Sebastian Graf at 2022-12-15T10:07:46+00:00
DmdAnal: Reflect the `seq` of strict fields of a DataCon worker (#22475)

See the updated `Note [Data-con worker strictness]`
and the new `Note [Demand transformer for data constructors]`.

Fixes #22475.

(cherry picked from commit b4cfa8e235715d8c73b2ba0ba05ed8ef92629218)

- - - - -
c701cb6e by Sebastian Graf at 2022-12-15T11:04:35+00:00
DmdAnal: Don't panic in addCaseBndrDmd (#22039)

Rather conservatively return Top.
See Note [Untyped demand on case-alternative binders].

I also factored `addCaseBndrDmd` into two separate functions `scrutSubDmd` and
`fieldBndrDmds`.

Fixes #22039.

(cherry picked from commit d2be80fd9b222963e8dd09a30f78c106e00da7f9)

- - - - -
723fe2e6 by Matthew Pickering at 2022-12-15T11:18:08+00:00
Bump version to 9.4.4

- - - - -
f6aee846 by Matthew Pickering at 2022-12-15T11:35:01+00:00
Add 9.4.4 release notes

- - - - -
87e87896 by Ben Gamari at 2022-12-21T15:13:05-05:00
llvmGen: Fix relaxed ordering

Previously I used LLVM's `unordered` ordering for the C11 `relaxed`
ordering. However, this is wrong and should rather use the LLVM
`monotonic` ordering.

Fixes #22640
- - - - -
0476f4e6 by Ben Gamari at 2022-12-22T17:09:46-05:00
gitlab: Reintroduce Fedora 27 job

- - - - -


30 changed files:

- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- + compiler/GHC/Builtin/PrimOps/Casts.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow/Block.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Ppr.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/Linker/Windows.hs
- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Stg/Lint.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2071285563fc705917873704a52eb4f6dd337651...0476f4e64c9151d18854844a8803b27781da447b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/2071285563fc705917873704a52eb4f6dd337651...0476f4e64c9151d18854844a8803b27781da447b
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/20221222/0bbe5600/attachment-0001.html>


More information about the ghc-commits mailing list