[Git][ghc/ghc][wip/less-defaulting] 37 commits: Avoid desugaring non-recursive lets into recursive lets

Krzysztof Gogolewski (@monoidal) gitlab at gitlab.haskell.org
Mon Jun 26 21:28:23 UTC 2023



Krzysztof Gogolewski pushed to branch wip/less-defaulting at Glasgow Haskell Compiler / GHC


Commits:
3e80c2b4 by Arnaud Spiwack at 2023-06-20T03:19:41-04:00
Avoid desugaring non-recursive lets into recursive lets

This prepares for having linear let expressions in the frontend.

When desugaring lets, SPECIALISE statements create more copies of a
let binding. Because of the rewrite rules attached to the bindings,
there are dependencies between the generated binds.

Before this commit, we simply wrapped all these in a mutually
recursive let block, and left it to the simplified to sort it out.

With this commit: we are careful to generate the bindings in
dependency order, so that we can wrap them in consecutive lets (if the
source is non-recursive).

- - - - -
9fad49e0 by Ben Gamari at 2023-06-20T03:20:19-04:00
rts: Do not call exit() from SIGINT handler

Previously `shutdown_handler` would call `stg_exit` if the scheduler was
Oalready found to be in `SCHED_INTERRUPTING` state (or higher). However,
`stg_exit` is not signal-safe as it calls `exit` (which calls `atexit`
handlers). The only safe thing to do in this situation is to call
`_exit`, which terminates with minimal cleanup.

Fixes #23417.

- - - - -
7485f848 by Bodigrim at 2023-06-20T03:20:57-04:00
Bump Cabal submodule

This requires changing the recomp007 test because now cabal passes
`this-unit-id` to executable components, and that unit-id contains a
hash which includes the ABI of the dependencies. Therefore changing the
dependencies means that -this-unit-id changes and recompilation is
triggered.

The spririt of the test is to test GHC's recompilation logic assuming
that `-this-unit-id` is constant, so we explicitly pass `-ipid` to
`./configure` rather than letting `Cabal` work it out.

- - - - -
1464a2a8 by mangoiv at 2023-06-20T03:21:34-04:00
[feat] add a hint to `HasField` error message
- add a hint that indicates that the record that the record dot is used
  on might just be missing a field
- as the intention of the programmer is not entirely clear, it is only
  shown if the type is known
- This addresses in part issue #22382

- - - - -
b65e78dd by Ben Gamari at 2023-06-20T16:56:43-04:00
rts/ipe: Fix unused lock warning

- - - - -
6086effd by Ben Gamari at 2023-06-20T16:56:44-04:00
rts/ProfilerReportJson: Fix memory leak

- - - - -
1e48c434 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Various warnings fixes

- - - - -
471486b9 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix printf format mismatch

- - - - -
80603fb3 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix incorrect #include <sys/poll.h>

According to Alpine's warnings and poll(2), <poll.h> should be
preferred.

- - - - -
ff18e6fd by Ben Gamari at 2023-06-20T16:56:44-04:00
nonmoving: Fix unused definition warrnings

- - - - -
6e7fe8ee by Ben Gamari at 2023-06-20T16:56:44-04:00
Disable futimens on Darwin.

See #22938

- - - - -
b7706508 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix incorrect CPP guard

- - - - -
94f00e9b by Ben Gamari at 2023-06-20T16:56:44-04:00
hadrian: Ensure that -Werror is passed when compiling the RTS.

Previously the `+werror` transformer would only pass `-Werror` to GHC,
which does not ensure that the same is passed to the C compiler when
building the RTS. Arguably this is itself a bug but for now we will just
work around this by passing `-optc-Werror` to GHC.

I tried to enable `-Werror` in all C compilations but the boot libraries
are something of a portability nightmare.

- - - - -
5fb54bf8 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Disable `#pragma GCC`s on clang compilers

Otherwise the build fails due to warnings. See #23530.

- - - - -
cf87f380 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix capitalization of prototype

- - - - -
17f250d7 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix incorrect format specifier

- - - - -
0ff1c501 by Josh Meredith at 2023-06-20T16:57:20-04:00
JS: remove js_broken(22576) in favour of the pre-existing wordsize(32) condition (#22576)

- - - - -
3d1d42b7 by Finley McIlwaine at 2023-06-21T12:04:58-04:00
Memory usage fixes for Haddock

- Do not include `mi_globals` in the `NoBackend` backend. It was only included
  for Haddock, but Haddock does not actually need it. This causes a 200MB
  reduction in max residency when generating haddocks on the Agda codebase
  (roughly 1GB to 800MB).

- Make haddock_{parser,renamer}_perf tests more accurate by forcing docs to
  be written to interface files using `-fwrite-interface`

Bumps haddock submodule.

Metric Decrease:
    haddock.base

- - - - -
8185b1c2 by Finley McIlwaine at 2023-06-21T12:04:58-04:00
Fix associated data family doc structure items

Associated data families were being given their own export DocStructureItems,
which resulted in them being documented separately from their classes in
haddocks. This commit fixes it.

- - - - -
4d356ea3 by Sylvain Henry at 2023-06-21T12:04:59-04:00
JS: implement TH support

- Add ghc-interp.js bootstrap script for the JS interpreter
- Interactively link and execute iserv code from the ghci package
- Incrementally load and run JS code for splices into the running iserv

Co-authored-by: Luite Stegeman <stegeman at gmail.com>

- - - - -
3249cf12 by Sylvain Henry at 2023-06-21T12:04:59-04:00
Don't use getKey

- - - - -
f84ff161 by Sylvain Henry at 2023-06-21T12:04:59-04:00
Stg: return imported FVs

This is used to determine what to link when using the interpreter.
For now it's only used by the JS interpreter but it could easily be used
by the native interpreter too (instead of extracting names from compiled BCOs).

- - - - -
fab2ad23 by Sylvain Henry at 2023-06-21T12:04:59-04:00
Fix some recompilation avoidance tests

- - - - -
a897dc13 by Sylvain Henry at 2023-06-21T12:04:59-04:00
TH_import_loop is now broken as expected

- - - - -
dbb4ad51 by Sylvain Henry at 2023-06-21T12:04:59-04:00
JS: always recompile when TH is enabled (cf #23013)

- - - - -
711b1d24 by Bartłomiej Cieślar at 2023-06-21T12:59:27-04:00
Add support for deprecating exported items (proposal #134)

This is an implementation of the deprecated exports proposal #134.
The proposal introduces an ability to introduce warnings to exports.
This allows for deprecating a name only when it is exported from a specific
module, rather than always depreacting its usage. In this example:

    module A ({-# DEPRECATED "do not use" #-} x) where
    x = undefined
    ---
    module B where
    import A(x)

`x` will emit a warning when it is explicitly imported.

Like the declaration warnings, export warnings are first accumulated within
the `Warnings` struct, then passed into the ModIface, from which they are
then looked up and warned about in the importing module in the `lookup_ie`
helpers of the `filterImports` function (for the explicitly imported names)
and in the `addUsedGRE(s)` functions where they warn about regular usages
of the imported name.

In terms of the AST information, the custom warning is stored in the
extension field of the variants of the `IE` type (see Trees that Grow for
more information).

The commit includes a bump to the haddock submodule added in MR #28

Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com>

- - - - -
c1865854 by Ben Gamari at 2023-06-21T12:59:30-04:00
configure: Bump version to 9.8

Bumps Haddock submodule

- - - - -
4e1de71c by Ben Gamari at 2023-06-21T21:07:48-04:00
configure: Bump version to 9.9

Bumps haddock submodule.

- - - - -
5b6612bc by Ben Gamari at 2023-06-23T03:56:49-04:00
rts: Work around missing prototypes errors

Darwin's toolchain inexpliciably claims that `write_barrier` and friends
have declarations without prototypes, despite the fact that (a) they are
definitions, and (b) the prototypes appear only a few lines above. Work
around this by making the definitions proper prototypes.

- - - - -
43b66a13 by Matthew Pickering at 2023-06-23T03:57:26-04:00
ghcup-metadata: Fix date modifier (M = minutes, m = month)

Fixes #23552

- - - - -
564164ef by Luite Stegeman at 2023-06-24T10:27:29+09:00
Support large stack frames/offsets in GHCi bytecode interpreter

Bytecode instructions like PUSH_L (push a local variable) contain
an operand that refers to the stack slot. Before this patch, the
operand type was SmallOp (Word16), limiting the maximum stack
offset to 65535 words. This could cause compiler panics in some
cases (See #22888).

This patch changes the operand type for stack offsets from
SmallOp to Op, removing the stack offset limit.

Fixes #22888

- - - - -
8d6574bc by Sylvain Henry at 2023-06-26T13:15:06-04:00
JS: support levity-polymorphic datatypes (#22360,#22291)

- thread knowledge about levity into PrimRep instead of panicking
- JS: remove assumption that unlifted heap objects are rts objects (TVar#, etc.)

Doing this also fixes #22291 (test added).

There is a small performance hit (~1% more allocations).

Metric Increase:
    T18698a
    T18698b

- - - - -
5578bbad by Matthew Pickering at 2023-06-26T13:15:43-04:00
MR Review Template: Mention "Blocked on Review" label

In order to improve our MR review processes we now have the label
"Blocked on Review" which allows people to signal that a MR is waiting
on a review to happen.

See: https://mail.haskell.org/pipermail/ghc-devs/2023-June/021255.html

- - - - -
4427e9cf by Matthew Pickering at 2023-06-26T13:15:43-04:00
Move MR template to Default.md

This makes it more obvious what you have to modify to affect the default
template rather than looking in the project settings.

- - - - -
522bd584 by Arnaud Spiwack at 2023-06-26T13:16:33-04:00
Revert "Avoid desugaring non-recursive lets into recursive lets"

This (temporary) reverts commit 3e80c2b40213bebe302b1bd239af48b33f1b30ef.

Fixes #23550

- - - - -
dbc253e6 by Krzysztof Gogolewski at 2023-06-26T23:27:44+02:00
Change the defaulting rules in commitFlexi

- Multiplicity isn't special, default to Any
- RuntimeRep and Levity are special only when concrete

- - - - -
7da09819 by Krzysztof Gogolewski at 2023-06-26T23:27:44+02:00
Workaround 23380

Without it, fails on

f :: Bool -> Bool
f x = case x of
        True -> True
        a -> a

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/merge_request_templates/merge-request.md → .gitlab/merge_request_templates/Default.md
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Env.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1d8bf940d135737acf4d030a8b746221a2a5cbbb...7da098191b661cb9385e297bf49fdc348f8f4b22

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/1d8bf940d135737acf4d030a8b746221a2a5cbbb...7da098191b661cb9385e297bf49fdc348f8f4b22
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/20230626/a5086b84/attachment-0001.html>


More information about the ghc-commits mailing list