[Git][ghc/ghc][wip/21611-move-corem] 63 commits: Various Hadrian bootstrapping fixes

Dominik Peteler (@mmhat) gitlab at gitlab.haskell.org
Tue Sep 6 20:44:53 UTC 2022



Dominik Peteler pushed to branch wip/21611-move-corem at Glasgow Haskell Compiler / GHC


Commits:
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.

- - - - -
d2be80fd by Sebastian Graf at 2022-09-05T23:12:14-04: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.

- - - - -
25f68ace by Ben Gamari at 2022-09-05T23:12:50-04:00
gitlab-ci: Ensure that ghc derivation is in scope

Previously the lint-ci job attempted to use cabal-install (specifically
`cabal update`) without a GHC in PATH. However, cabal-install-3.8
appears to want GHC, even for `cabal update`.

- - - - -
f37b621f by sheaf at 2022-09-06T11:51:53+00:00
Update instances.rst, clarifying InstanceSigs

Fixes #22103

- - - - -
d4f908f7 by Jan Hrček at 2022-09-06T15:36:58-04:00
Fix :add docs in user guide

- - - - -
808bb793 by Cheng Shao at 2022-09-06T15:37:35-04:00
ci: remove unused build_make/test_make in ci script

- - - - -
e91112a1 by Dominik Peteler at 2022-09-06T22:43:59+02:00
Move CoreM to GHC.Plugins.Monad

Removes the uses of CoreM in the Specialise, SpecConstr and CallerCC
pass. Since CoreM is now only used by Core2core plugins within the Core
pipeline the monad got moved to an own module.

Additionally CoreToDo and related types got moved to an own module
GHC.Core.Opt.Pipeline.Types.

Moved the remaining code from GHC.Core.Opt.Monad to GHC.Core.Opt.Utils.

GHC.Core.Opt.{SpecConstr,CallerCC} got proper configs / the usual treatment.

Split out GHC.Core.Opt.CallerCC.Filter to avoid hs-boot.

Removed explicit PrintUnqualified argument from `endPassIO`

Removed `CoreToDo` from GHC.Core.Lint and GHC.CoreToStg.Prep

Fixes #21611.

- - - - -
4395ab05 by Dominik Peteler at 2022-09-06T22:44:07+02:00
Removed CoreM uses from GHC.Core.Lint

- - - - -
5420618a by Dominik Peteler at 2022-09-06T22:44:09+02:00
Purified GHC.Core.LateCC.addLateCostCentres

 * GHC.Driver.Config.Core.Lint:
    * Removed: endPass
    * Renamed: endPassHscEnvIO -> endPass
 * Moved GHC.Core.Opt.Pipeline.initLintAnnotationsConfig to
   GHC.Driver.Config.Core.Lint

- - - - -
85c75ba1 by Dominik Peteler at 2022-09-06T22:44:11+02:00
Run the CoreToDo interpreter in an own monad `SimplCountM`

This monad is just `StateT SimplCount IO` wrapped in a newtype.
This way we get rid of some `Core.Opt.Pipeline` boilerplate.

It lives in GHC.Core.Opt.Counting and `Tick` and `SimplCount` got moved
there as well.

Also:
 * GHC.Core.Opt.Pipeline.runCorePasses: Take logger service as an
   argument

- - - - -
319ffb38 by Dominik Peteler at 2022-09-06T22:44:13+02:00
Removed references to driver from Specialise pass

- - - - -
7ddac9ba by Dominik Peteler at 2022-09-06T22:44:14+02:00
Split `Core.EndPass` from `Core.Lint`

This better sepates concerns (linting is domain layer, end pass
diagnostics is application later), and `Core.Lint` is a huge module to
boot.

- - - - -
ccbb96d4 by Dominik Peteler at 2022-09-06T22:44:15+02:00
Get rid of `CoreDesugar`, `CoreDesugarOpt`, `CoreTidy`, `CorePrep`

Those are not Core -> Core passes and so they don't belong in that sum type.

Also cleaned up a bit:

 * Removed 'GHC.Driver.Config.Core.Lint.lintCoreBindings'
   It was dead code.

 * Removed 'GHC.Driver.Config.Core.Lint.lintPassResult'
   It run the actual linting and therefore it didn't belong to the
   GHC.Driver.Config namespace. As it was used only once the definition
   got inlined.

 * GHC.Core.Lint: Renamed lintPassResult' to lintPassResult.
   Also renamed lintCoreBindings' to lintCoreBindings.

 * GHC.Driver.Config.Core.Lint: Stick to the defaults when initializing
   the config records.

 * GHC.Driver.Config.Core.EndPass: Inlined `endPass`

 * GHC.Driver.Config.Core.EndPass: Removed `endPassLintFlags` as it was never used

- - - - -
d0299510 by Dominik Peteler at 2022-09-06T22:44:15+02:00
Simplified initSimplifyOpts

- - - - -
e503faf3 by Dominik Peteler at 2022-09-06T22:44:17+02:00
Adjusted tests

- - - - -
278e2d33 by Dominik Peteler at 2022-09-06T22:44:18+02:00
Removed RuleBase from getCoreToDo

- - - - -
84a46d19 by Dominik Peteler at 2022-09-06T22:44:19+02:00
Purified initSpecialiseOpts

Also pass the rule bases and the visible orphan modules as arguments to
the Specialise pass.

- - - - -
e9570f9c by Dominik Peteler at 2022-09-06T22:44:20+02:00
Simplified CoreToDo interpreter a bit

- - - - -
9a35c91a by Dominik Peteler at 2022-09-06T22:44:21+02:00
Config records of some Core passes are now provided by CoreToDo

 * CoreAddCallerCcs
 * CoreAddLateCcs
 * CoreDoFloatInwards
 * CoreLiberateCase
 * CoreDoSpecConstr

- - - - -
35b143a0 by Dominik Peteler at 2022-09-06T22:44:22+02:00
Move Core pipeline to the driver

 * Moved `getCoreToDo` to an own module GHC.Driver.Config.Core.Opt
 * Moved the remaining part of GHC.Core.Opt.Pipeline to a new module GHC.Driver.Core.Opt
 * Renamed GHC.Core.Opt.Pipeline.Types to GHC.Core.Opt.Config

- - - - -
e8d58107 by Dominik Peteler at 2022-09-06T22:44:23+02:00
Fixed tests

- - - - -
121e3aef by Dominik Peteler at 2022-09-06T22:44:23+02:00
Fixed note

- - - - -
b36c6b66 by John Ericson at 2022-09-06T22:44:24+02:00
Add some haddocks

- - - - -
eaf007f8 by John Ericson at 2022-09-06T22:44:25+02:00
Move `core2core` to `GHC.Driver.Main`

This "pushes up" the planning vs execution split, by not combining the
two until a further downstream module. That helps encourage this
separation we are very much fans of.

Also deduplicate some logic with `liftCoreMToSimplCountM`, which
abstracts over a number of details to eliminate a `CoreM` to a
`SimpleCountM`. It might be a bit too opinionated at the moment, in
which case we will think about how to shuffle some things around.

In addition, deduplicate `simplMask`, which is indeed sketchy thing to
export, but we can deal with that later.

- - - - -
fd8b3dea by John Ericson at 2022-09-06T22:44:26+02:00
Factor out `readRuleEnv` into its own module nad give haddocks

Might end up up recombining this but its good separation of concerns for
now.

- - - - -
6384eb4f by John Ericson at 2022-09-06T22:44:27+02:00
Quick and dirty chop up modules once again

I decided my earlier recommendation to mmhat was not quite write. It was
the one I implemented too. So through this together real quick and
dirty. We can make it nicer afterwords

Things that are not yet nice:

 - `CoreOptEnv` is a grab bag of junk. Of course, it is merely reifying
   how was were accessing `HscEnv` before --- also rather junky! So
   maybe it cannot totally be improved. But it would be good to go over
   bits and ask / make issues (like #21926) that would help us clean up
   later.

 - Logging tricks for annotations linting is broken from the planning vs
   execution separation. We'll need to "delay that part of planning too.
   Can hack it up with more higher order function tricks, might be also
   a good oppertunity to rethink what should go in which config.

 - Some of the per-pass config records require info that isn't available
   at planning time. I hacked up up with functions in `CoreToDo` but we
   could do better.

   Conversely, per #21926, perhaps we *should* include the module name
   in the config after all, since we know it from downsweep before
   upsweep begins.

 - `GHC.Driver.Core.Rules` could just go inside `GHC.Driver.Core.Opt`.

- - - - -
eda8e833 by John Ericson at 2022-09-06T22:44:28+02:00
Split `GHC.Core.Opt.Utils`

Half of it was domain layer (float out switches) but the other half was
infrastructure / driver (annotations).

- - - - -
c6dc49c2 by Dominik Peteler at 2022-09-06T22:44:29+02:00
Fixed tests

- - - - -
e5e6d0ae by Dominik Peteler at 2022-09-06T22:44:30+02:00
Better configuration of Core lint debug options

- - - - -
c828aca8 by Dominik Peteler at 2022-09-06T22:44:31+02:00
Configuration record for rule check pass

- - - - -
c874ef82 by Dominik Peteler at 2022-09-06T22:44:32+02:00
Renamed dmdAnal to demandAnalysis and moved it to GHC.Core.Opt.DmdAnal

- - - - -
7a0c82c0 by Dominik Peteler at 2022-09-06T22:44:33+02:00
Fix tests

- - - - -
c68f3edb by Dominik Peteler at 2022-09-06T22:44:34+02:00
Added environment for worker/wrapper pass

- - - - -
34cab7ac by Dominik Peteler at 2022-09-06T22:44:35+02:00
Refactored configuration of Specialise pass again

Also removed GHC.Core.Opt.Specialise.Config again. We may introduce separate
*.Config modules for the passes once we had a look at the module graph
and decide whether the addition of these modules is justified.

- - - - -
1ac1f7ec by Dominik Peteler at 2022-09-06T22:44:36+02:00
Removed GHC.Driver.Core.Rules

- - - - -
43e46675 by Dominik Peteler at 2022-09-06T22:44:37+02:00
Removed CoreDoNothing and CoreDoPasses

Rewrote the getCoreToDo function using a Writer monad. This makes these
data constructors superfluous.

- - - - -
7e2e4341 by Dominik Peteler at 2022-09-06T22:44:38+02:00
Renamed endPassIO to endPass

- - - - -
f070c2af by Dominik Peteler at 2022-09-06T22:44:38+02:00
Renamed hscSimplify/hscSimplify' to optimizeCoreIO/optimizeCoreHsc

- - - - -
e4664fb3 by Dominik Peteler at 2022-09-06T22:44:39+02:00
Run simplifyPgm in SimplCountM

- - - - -
bea12fe4 by Dominik Peteler at 2022-09-06T22:44:40+02:00
Added note on the architecture of the Core optimizer

- - - - -
e4e813df by Dominik Peteler at 2022-09-06T22:44:41+02:00
Merged GHC.Driver.Config.Core.Opt.* modules in GHC.Driver.Config.Core.Opt

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- compiler/GHC.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- + compiler/GHC/Core/EndPass.hs
- compiler/GHC/Core/LateCC.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Lint/Interactive.hs
- + compiler/GHC/Core/Opt.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CallerCC.hs
- − compiler/GHC/Core/Opt/CallerCC.hs-boot
- + compiler/GHC/Core/Opt/CallerCC/Filter.hs
- compiler/GHC/Core/Opt/Pipeline/Types.hs → compiler/GHC/Core/Opt/Config.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/FloatOut.hs
- + compiler/GHC/Core/Opt/FloatOutSwitches.hs
- − compiler/GHC/Core/Opt/Pipeline.hs
- + compiler/GHC/Core/Opt/RuleCheck.hs
- compiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify.hs
- compiler/GHC/Core/Opt/Simplify/Monad.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Opt/Stats.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/78c3cf49346ab211b9c20db978c73d4ddf9b7b4f...e4e813df1d9762c92927381159b9cd9cff19bcb3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/78c3cf49346ab211b9c20db978c73d4ddf9b7b4f...e4e813df1d9762c92927381159b9cd9cff19bcb3
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/20220906/0ece9fb3/attachment-0001.html>


More information about the ghc-commits mailing list