[Git][ghc/ghc][wip/T21623] 89 commits: Pmc: consider any 2 dicts of the same type equal

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Mon Sep 5 23:00:28 UTC 2022



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


Commits:
4786acf7 by sheaf at 2022-08-26T15:05:23-04:00
Pmc: consider any 2 dicts of the same type equal

This patch massages the keys used in the `TmOracle` `CoreMap` to ensure
that dictionaries of coherent classes give the same key.
That is, whenever we have an expression we want to insert or lookup in
the `TmOracle` `CoreMap`, we first replace any dictionary
`$dict_abcd :: ct` with a value of the form `error @ct`.

This allows us to common-up view pattern functions with required
constraints whose arguments differed only in the uniques of the
dictionaries they were provided, thus fixing #21662.

This is a rather ad-hoc change to the keys used in the
`TmOracle` `CoreMap`. In the long run, we would probably want to use
a different representation for the keys instead of simply using
`CoreExpr` as-is. This more ambitious plan is outlined in #19272.

Fixes #21662
Updates unix submodule

- - - - -
f5e0f086 by Krzysztof Gogolewski at 2022-08-26T15:06:01-04:00
Remove label style from printing context

Previously, the SDocContext used for code generation contained
information whether the labels should use Asm or C style.
However, at every individual call site, this is known statically.
This removes the parameter to 'PprCode' and replaces every 'pdoc'
used to print a label in code style with 'pprCLabel' or 'pprAsmLabel'.
The OutputableP instance is now used only for dumps.

The output of T15155 changes, it now uses the Asm style
(which is faithful to what actually happens).

- - - - -
1007829b by Cheng Shao at 2022-08-26T15:06:40-04:00
boot: cleanup legacy args

Cleanup legacy boot script args, following removal of the legacy make
build system.

- - - - -
95fe09da by Simon Peyton Jones at 2022-08-27T00:29:02-04:00
Improve SpecConstr for evals

As #21763 showed, we were over-specialising in some cases, when
the function involved was doing a simple 'eval', but not taking
the value apart, or branching on it.

This MR fixes the problem.  See Note [Do not specialise evals].

Nofib barely budges, except that spectral/cichelli allocates about
3% less.

Compiler bytes-allocated improves a bit
   geo. mean                                          -0.1%
   minimum                                            -0.5%
   maximum                                            +0.0%

The -0.5% is on T11303b, for what it's worth.

- - - - -
565a8ec8 by Matthew Pickering at 2022-08-27T00:29:39-04:00
Revert "Revert "Refactor SpecConstr to use treat bindings uniformly""

This reverts commit 851d8dd89a7955864b66a3da8b25f1dd88a503f8.

This commit was originally reverted due to an increase in space usage.
This was diagnosed as because the SCE increased in size and that was
being retained by another leak. See #22102

- - - - -
82ce1654 by Matthew Pickering at 2022-08-27T00:29:39-04:00
Avoid retaining bindings via ModGuts held on the stack

It's better to overwrite the bindings fields of the ModGuts before
starting an iteration as then all the old bindings can be collected as
soon as the simplifier has processed them. Otherwise we end up with the
old bindings being alive until right at the end of the simplifier pass
as the mg_binds field is only modified right at the end.

- - - - -
64779dcd by Matthew Pickering at 2022-08-27T00:29:39-04:00
Force imposs_deflt_cons in filterAlts

This fixes a pretty serious space leak as the forced thunk would retain
`Alt b` values which would then contain reference to a lot of old
bindings and other simplifier gunk.

The OtherCon unfolding was not forced on subsequent simplifier runs so
more and more old stuff would be retained until the end of
simplification.

Fixing this has a drastic effect on maximum residency for the mmark
package which goes from

```
  45,005,401,056 bytes allocated in the heap
  17,227,721,856 bytes copied during GC
     818,281,720 bytes maximum residency (33 sample(s))
       9,659,144 bytes maximum slop
            2245 MiB total memory in use (0 MB lost due to fragmentation)
```

to

```
  45,039,453,304 bytes allocated in the heap
  13,128,181,400 bytes copied during GC
     331,546,608 bytes maximum residency (40 sample(s))
       7,471,120 bytes maximum slop
             916 MiB total memory in use (0 MB lost due to fragmentation)
```

See #21993 for some more discussion.

- - - - -
a3b23a33 by Matthew Pickering at 2022-08-27T00:29:39-04:00
Use Solo to avoid retaining the SCE but to avoid performing the substitution

The use of Solo here allows us to force the selection into the SCE to obtain
the Subst but without forcing the substitution to be applied. The resulting thunk
is placed into a lazy field which is rarely forced, so forcing it regresses
peformance.

- - - - -
161a6f1f by Simon Peyton Jones at 2022-08-27T00:30:14-04:00
Fix a nasty loop in Tidy

As the remarkably-simple #22112 showed, we were making a black hole
in the unfolding of a self-recursive binding.  Boo!

It's a bit tricky.  Documented in GHC.Iface.Tidy,
   Note [tidyTopUnfolding: avoiding black holes]

- - - - -
68e6786f by Giles Anderson at 2022-08-29T00:01:35+02:00
Use TcRnDiagnostic in GHC.Tc.TyCl.Class (#20117)

The following `TcRnDiagnostic` messages have been introduced:

TcRnIllegalHsigDefaultMethods
TcRnBadGenericMethod
TcRnWarningMinimalDefIncomplete
TcRnDefaultMethodForPragmaLacksBinding
TcRnIgnoreSpecialisePragmaOnDefMethod
TcRnBadMethodErr
TcRnNoExplicitAssocTypeOrDefaultDeclaration

- - - - -
cbe51ac5 by Simon Peyton Jones at 2022-08-29T04:18:57-04:00
Fix a bug in anyInRnEnvR

This bug was a subtle error in anyInRnEnvR, introduced by

    commit d4d3fe6e02c0eb2117dbbc9df72ae394edf50f06
    Author: Andreas Klebinger <klebinger.andreas at gmx.at>
    Date:   Sat Jul 9 01:19:52 2022 +0200

    Rule matching: Don't compute the FVs if we don't look at them.

The net result was #22028, where a rewrite rule would wrongly
match on a lambda.

The fix to that function is easy.

- - - - -
0154bc80 by sheaf at 2022-08-30T06:05:41-04:00
Various Hadrian bootstrapping fixes

  - Don't always produce a distribution archive (#21629)
  - Use correct executable names for ghc-pkg and hsc2hs on windows
    (we were missing the .exe file extension)
  - Fix a bug where we weren't using the right archive format on Windows
    when unpacking the bootstrap sources.

Fixes #21629

- - - - -
451b1d90 by Matthew Pickering at 2022-08-30T06:06:16-04:00
ci: Attempt using normal submodule cloning strategy

We do not use any recursively cloned submodules, and this protects us
from flaky upstream remotes.

Fixes #22121

- - - - -
9d5ad7c4 by Pi Delport at 2022-08-30T22:40:46+00:00
Fix typo in Any docs: stray "--"

- - - - -
3a002632 by Pi Delport at 2022-08-30T22:40:46+00:00
Fix typo in Any docs: syntatic -> syntactic

- - - - -
7f490b13 by Simon Peyton Jones at 2022-08-31T03:53:54-04:00
Add a missing trimArityType

This buglet was exposed by #22114, a consequence of my earlier
refactoring of arity for join points.

- - - - -
e6fc820f by Ben Gamari at 2022-08-31T13:16:01+01:00
Bump binary submodule to 0.8.9.1

- - - - -
4c1e7b22 by Ben Gamari at 2022-08-31T13:16:01+01:00
Bump stm submodule to 2.5.1.0

- - - - -
837472b4 by Ben Gamari at 2022-08-31T13:16:01+01:00
users-guide: Document system-cxx-std-lib

- - - - -
f7a9947a by Douglas Wilson at 2022-08-31T13:16:01+01:00
Update submodule containers to 0.6.6

- - - - -
4ab1c2ca by Douglas Wilson at 2022-08-31T13:16:02+01:00
Update submodule process to 1.6.15.0

- - - - -
1309ea1e by Ben Gamari at 2022-08-31T13:16:02+01:00
Bump directory submodule to 1.3.7.1

- - - - -
7962a33a by Douglas Wilson at 2022-08-31T13:16:02+01:00
Bump text submodule to 2.0.1

- - - - -
fd8d80c3 by Ben Gamari at 2022-08-31T13:26:52+01:00
Bump deepseq submodule to 1.4.8.0

- - - - -
a9baafac by Ben Gamari at 2022-08-31T13:26:52+01:00
Add dates to base, ghc-prim changelogs

- - - - -
2cee323c by Ben Gamari at 2022-08-31T13:26:52+01:00
Update autoconf scripts

Scripts taken from autoconf 02ba26b218d3d3db6c56e014655faf463cefa983

- - - - -
e62705ff by Ben Gamari at 2022-08-31T13:26:53+01:00
Bump bytestring submodule to 0.11.3.1

- - - - -
f7b4dcbd by Douglas Wilson at 2022-08-31T13:26:53+01:00
Update submodule Cabal to tag Cabal-v3.8.1.0

closes #21931

- - - - -
e8eaf807 by Matthew Pickering at 2022-08-31T18:27:57-04:00
Refine in-tree compiler args for --test-compiler=stage1

Some of the logic to calculate in-tree arguments was not correct for the
stage1 compiler. Namely we were not correctly reporting whether we were
building static or dynamic executables and whether debug assertions were
enabled.

Fixes #22096

- - - - -
6b2f7ffe by Matthew Pickering at 2022-08-31T18:27:57-04:00
Make ghcDebugAssertions into a Stage predicate (Stage -> Bool)

We also care whether we have debug assertions enabled for a stage one
compiler, but the way which we turned on the assertions was quite
different from the stage2 compiler. This makes the logic for turning on
consistent across both and has the advantage of being able to correct
determine in in-tree args whether a flavour enables assertions or not.

Ticket #22096

- - - - -
15111af6 by Zubin Duggal at 2022-09-01T01:18:50-04:00
Add regression test for #21550

This was fixed by ca90ffa321a31842a32be1b5b6e26743cd677ec5
"Use local instances with least superclass depth"

- - - - -
7d3a055d by Krzysztof Gogolewski at 2022-09-01T01:19:26-04:00
Minor cleanup

- Remove mkHeteroCoercionType, sdocImpredicativeTypes, isStateType (unused),
  isCoVar_maybe (duplicated by getCoVar_maybe)
- Replace a few occurrences of voidPrimId with (# #).
  void# is a deprecated synonym for the unboxed tuple.
- Use showSDoc in :show linker.
  This makes it consistent with the other :show commands

- - - - -
31a8989a by Tommy Bidne at 2022-09-01T12:01:20-04:00
Change Ord defaults per CLC proposal

Approved by CLC in https://github.com/haskell/core-libraries-committee/issues/24#issuecomment-1233331267

- - - - -
7f527f01 by Matthew Pickering at 2022-09-01T12:01:56-04:00
Fix bootstrap with ghc-9.0

It turns out Solo is a very recent addition to base, so for older GHC
versions we just defined it inline here the one place we use it in the
compiler.

- - - - -
b06fa8c3 by Simon Peyton Jones at 2022-09-05T20:06:44+01:00
Start work

Not ready for review

- - - - -
c4b59a45 by Simon Peyton Jones at 2022-09-05T20:06:44+01:00
More progress

- - - - -
618cb025 by Simon Peyton Jones at 2022-09-05T20:06:44+01:00
Wibbles

- - - - -
5f498bdf by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Stage1 compiles

- - - - -
92ac4cad by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
More wibbles

- - - - -
b9f17737 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
More wibbles

- - - - -
49783f5b by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
More -- almost working

- - - - -
011848ae by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Comments

- - - - -
2a8f0d03 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibbles

- - - - -
69576ce1 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibbles

- - - - -
7029f7d1 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble inlineId

- - - - -
501e7a73 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibbles

- - - - -
a6b061ed by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Infinite loop somewhere

- - - - -
1b2b8ba0 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
More wibbles.  Maybe can build stage2

- - - - -
bb5271d7 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Make FuNCo a thing by itself

- - - - -
0d820c27 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble

- - - - -
bcbd591e by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble

- - - - -
30177e05 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibbles

- - - - -
36a50ee1 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Fix OptCoercion

- - - - -
27879045 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble

- - - - -
ee2407bf by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble to optCoercion

- - - - -
f82370c5 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Replace SORT with TYPE and CONSTRAINT

- - - - -
07af5c04 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble

- - - - -
89ffa253 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Delete unused import

- - - - -
160e6dd7 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Delete TypeOrConstraint from ghc-prim:GHC.Types

- - - - -
2fe6836c by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Move from NthCo to SelCo

- - - - -
fc9b6044 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibbles

- - - - -
2c8e63e4 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibbles in RepType

- - - - -
ce819d2b by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Wibble

- - - - -
316cc764 by Simon Peyton Jones at 2022-09-05T20:06:45+01:00
Add mkWpEta

- - - - -
6d7b37e7 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Really add mkWpEta

- - - - -
ef2b4dcb by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Wibble Typeable binds etc

- - - - -
dbadfefa by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Improve error messages

- - - - -
b19c1fe1 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
More wibbles, mainly to error messages

- - - - -
4be94658 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Wibbles

- - - - -
8ec0904f by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Wibbles to errors

- - - - -
308f5612 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Wibbles

But especially: treat Constraint as Typeable

- - - - -
6ef5f6a2 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
More wibbles

- - - - -
7ffc3a4f by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
More changes

* Move role into SelTyCon
* Get rid of mkTcSymCo and friends

- - - - -
99ac0d72 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Unused variable

- - - - -
de91afaa by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Wibbles

- - - - -
d49ddb4d by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Wibble

- - - - -
aa67ee13 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Accept error message changes

- - - - -
5f4ba6b3 by Simon Peyton Jones at 2022-09-05T20:06:46+01:00
Refactoring...

Remove tc functions like tcKind, tcGetTyVar.

Move tyConsOfType, occCheckExpand to TyCo.FVs.

- - - - -
c02392ca by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Introduce GHC.Core.TyCo.Compare

Lots of import changes!

- - - - -
a9dc3187 by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Update haddock submodule (I hope)

- - - - -
5b9394a1 by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Wibbles (notably: actually add GHC.Core.TyCo.Compare)

- - - - -
e1234d76 by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Wibbles

- - - - -
22492032 by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Wibble output of T16575

- - - - -
8a4d59db by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Wibbles

- - - - -
ba47a0f9 by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
More wibbles

- - - - -
d376886f by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Remove infinite loop in T1946

See Note [ForAllTy and type equality]

- - - - -
97c34663 by Simon Peyton Jones at 2022-09-05T20:07:40+01:00
Deal with rejigConRes

Needs a Note to be written by Richard

- - - - -
acbc8835 by Simon Peyton Jones at 2022-09-05T23:52:47+01:00
Some renaming

AnonArgFlag -->  FunTyFlag
ArgFlag     -->  ForAllTyFlag

- - - - -
14bb809d by Simon Peyton Jones at 2022-09-06T00:00:33+01:00
Update haddock submodule

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- boot
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/Types.hs-boot
- compiler/GHC/Builtin/Types/Literals.hs
- compiler/GHC/Builtin/Types/Prim.hs
- − compiler/GHC/Builtin/Types/Prim.hs-boot
- compiler/GHC/Builtin/Uniques.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/DebugBlock.hs
- compiler/GHC/Cmm/Lint.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Dwarf.hs
- compiler/GHC/CmmToAsm/Dwarf/Types.hs
- compiler/GHC/CmmToAsm/PIC.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Opt.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7183bcc0d725688254b508908b1003429d648fd3...14bb809d309e0959191bc7efd2a022dd356c1df6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7183bcc0d725688254b508908b1003429d648fd3...14bb809d309e0959191bc7efd2a022dd356c1df6
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/20220905/ff3fa97e/attachment-0001.html>


More information about the ghc-commits mailing list