[Git][ghc/ghc][wip/T18765] 25 commits: Make the parser module less dependent on DynFlags

Sebastian Graf gitlab at gitlab.haskell.org
Fri Oct 2 10:09:04 UTC 2020



Sebastian Graf pushed to branch wip/T18765 at Glasgow Haskell Compiler / GHC


Commits:
8e3f00dd by Sylvain Henry at 2020-09-29T17:24:03+02:00
Make the parser module less dependent on DynFlags

Bump haddock submodule

- - - - -
3ab0d8f7 by Sebastian Graf at 2020-09-30T02:48:27-04:00
PmCheck: Long-distance information for LocalBinds (#18626)

Now `desugarLocalBind` (formerly `desugarLet`) reasons about

  * `FunBind`s that
    * Have no pattern matches (so which aren't functions)
    * Have a singleton match group with a single GRHS
    * (which may have guards)
  * and looks through trivial post-typechecking `AbsBinds` in doing so
    to pick up the introduced renamings.

And desugars to `PmLet` LYG-style guards. Since GRHSs are no longer
denoted simply by `NonEmpty PmGRHS`, but also need to carry a `[PmGrd]`
for the `PmLet`s from `LocalBind`s, I added `PmGRHSs` to capture that.

Since we call out to the desugarer more often, I found that there were
superfluous warnings emitted when desugaring e.g. case expressions.
Thus, I made sure that we deactivate any warnings in the LYG desugaring
steps by the new wrapper function `noCheckDs`.

There's a regression test in `T18626`. Fixes #18626.

- - - - -
f8f60efc by Ben Gamari at 2020-09-30T02:49:03-04:00
testsuite: Mark T12971 as broken on Windows

Due to #17945.

- - - - -
6527fc57 by Ben Gamari at 2020-09-30T02:49:03-04:00
Bump Cabal, hsc2hs, directory, process submodules

Necessary for recent Win32 bump.

- - - - -
df3f5880 by Sylvain Henry at 2020-09-30T02:49:41-04:00
Remove unsafeGlobalDynFlags (#17957, #14597)

There are still global variables but only 3 booleans instead of a single
DynFlags.

- - - - -
9befd94d by Sylvain Henry at 2020-09-30T02:49:41-04:00
Remove unused global variables

Some removed globals variables were still declared in the RTS.

They were removed in the following commits:

* 4fc6524a2a4a0003495a96c8b84783286f65c198
* 0dc7985663efa1739aafb480759e2e2e7fca2a36
* bbd3c399939311ec3e308721ab87ca6b9443f358

- - - - -
7c98699f by Richard Eisenberg at 2020-09-30T02:50:17-04:00
Omit redundant kind equality check in solver

See updated Note [Use loose types in inert set] in
GHC.Tc.Solver.Monad.

Close #18753.

- - - - -
39549826 by Sebastian Graf at 2020-09-30T02:50:54-04:00
Pmc: Don't call exprType on type arguments (#18767)

Fixes #18767.

- - - - -
235e410f by Richard Eisenberg at 2020-09-30T02:51:29-04:00
Regression test for #10709.

Close #10709

- - - - -
5c32655f by Ben Gamari at 2020-09-30T22:31:55-04:00
hadrian/doc: Clarify documentation of key-value configuration
- - - - -
0bb02873 by Sylvain Henry at 2020-10-01T18:34:53-04:00
Add test for T18574

- - - - -
e393f213 by Sylvain Henry at 2020-10-01T18:34:53-04:00
Allow fusion with catMaybes (#18574)

Metric Decrease:
   T18574

- - - - -
d2cfad96 by Fendor at 2020-10-01T18:35:33-04:00
Add mainModuleNameIs and demote mainModIs

Add `mainModuleNameIs` to DynFlags and demote
`mainModIs` to function which uses the homeUnit from DynFlags
it is created from.

- - - - -
fc351ab8 by Fendor at 2020-10-01T18:35:33-04:00
Use HomeUnit for main module without module declaration

- - - - -
dca1cb22 by Fendor at 2020-10-01T18:35:33-04:00
Remove mAIN completely

- - - - -
a5aaceec by Sylvain Henry at 2020-10-01T18:36:11-04:00
Use ADTs for parser errors/warnings

Haskell and Cmm parsers/lexers now report errors and warnings using ADTs
defined in GHC.Parser.Errors. They can be printed using functions in
GHC.Parser.Errors.Ppr.

Some of the errors provide hints with a separate ADT (e.g. to suggest to
turn on some extension). For now, however, hints are not consistent
across all messages. For example some errors contain the hints in the
main message. I didn't want to change any message with this patch. I
expect these changes to be discussed and implemented later.

Surprisingly, this patch enhances performance. On CI
(x86_64/deb9/hadrian, ghc/alloc):

   parsing001         -11.5%
   T13719             -2.7%
   MultiLayerModules  -3.5%
   Naperian           -3.1%

Bump haddock submodule

Metric Decrease:
    MultiLayerModules
    Naperian
    T13719
    parsing001

- - - - -
a946c7ef by Sylvain Henry at 2020-10-01T18:36:11-04:00
Less DynFlags in Header parsing

- - - - -
dafe7943 by Sylvain Henry at 2020-10-01T18:36:11-04:00
Parser: remove some unused imports

These are not reported by GHC because Happy adds {-# OPTIONS_GHC -w #-}

- - - - -
93d5de16 by Sylvain Henry at 2020-10-01T18:36:11-04:00
Don't import GHC.Unit to reduce the number of dependencies

- - - - -
e3655f81 by Sebastian Graf at 2020-10-01T18:36:47-04:00
Don't attach CPR signatures to NOINLINE data structures (#18154)

Because the generated `KindRep`s don't have an unfolding, !3230 did not
actually stop to compute, attach and serialise unnecessary CPR
signatures for them. As already said in
`Note [CPR for data structures]`, that leads to bloated interface
files which is ultimately quadratic for Nested CPR.

So we don't attach any CPR signature to bindings that

  * Are not thunks (because thunks are not in WHNF)
  * Have arity 0 (which means the top-level constructor is not a lambda)

If the data structure has an unfolding, we continue to look through it.
If not (as is the case for `KindRep`s), we look at the unchanged CPR
signature and see `topCprType`, as expected.

- - - - -
ba5965eb by Richard Eisenberg at 2020-10-01T18:37:23-04:00
Add regression test for #18755.

Close #18755

- - - - -
a8018c17 by Vladislav Zavialov at 2020-10-01T18:37:58-04:00
Fix pretty-printing of the mult-polymorphic arrow

A follow-up to !4020 (5830a12c46e7227c276a8a71213057595ee4fc04)

- - - - -
e5523324 by Sylvain Henry at 2020-10-01T18:38:35-04:00
Bignum: add integerNegate RULE

- - - - -
1edd6d21 by Vladislav Zavialov at 2020-10-01T18:39:10-04:00
Refactor: remove rnHsDoc

It did not do any useful work.

- - - - -
7f8866bf by Sebastian Graf at 2020-10-02T12:08:53+02:00
s/NOINLINE/NOINLINE[0]/g in GHC.Num.Integer (#18765)

This defeats constant-folding in the final phases of the Simplifier, but
enables us to get rid of allocations by inlining calls that can't be
constant-folded.

`NOINLINE[0]` is a better choice than `NOINLINE`, because

  1. We still delay inlining long enough for the constant-folding RULEs
     to fire
  2. The compiler has the option to inlining them late, possibly
     cancelling away boxes in the process.

`NOINLINE[0]` is a better choice than `INLINE[0]`, because

  3. We don't unconditionally inline huge definitions such as
     `integerDiv`, which would lead to code bloat at pretty much no
     gain.
  4. Since RULEs are unlikely to fire on the inlined RHS of e.g.
     `integerDiv`, there is no gain in inlining the unoptimised
     unfoldings.

We also have to mark all callers that want to participate in constant
folding as `INLINE`. See the new `Note [Integer constant folding]` for
details.

Fixes #18765.

Metric Decrease:
    T10359

- - - - -


30 changed files:

- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Monad.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Backpack/Syntax.hs
- compiler/GHC/Driver/Config.hs
- compiler/GHC/Driver/Finder.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Ppr.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session.hs-boot
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Check.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8320f630be066ec25245f18a67a38cdd05d211ee...7f8866bf419d9dce6666f93ea8ea551ac9b1a0f4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8320f630be066ec25245f18a67a38cdd05d211ee...7f8866bf419d9dce6666f93ea8ea551ac9b1a0f4
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/20201002/4ed3d0b6/attachment.html>


More information about the ghc-commits mailing list