summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add regression test for #21550wip/21550-testZubin Duggal2022-08-312-0/+40
| | | | | This was fixed by ca90ffa321a31842a32be1b5b6e26743cd677ec5 "Use local instances with least superclass depth"
* Add a missing trimArityTypeSimon Peyton Jones2022-08-314-146/+184
| | | | | This buglet was exposed by #22114, a consequence of my earlier refactoring of arity for join points.
* Fix typo in Any docs: syntatic -> syntacticPi Delport2022-08-301-1/+1
|
* Fix typo in Any docs: stray "--"Pi Delport2022-08-301-1/+1
|
* ci: Attempt using normal submodule cloning strategyMatthew Pickering2022-08-302-3/+3
| | | | | | | We do not use any recursively cloned submodules, and this protects us from flaky upstream remotes. Fixes #22121
* Various Hadrian bootstrapping fixessheaf2022-08-301-14/+22
| | | | | | | | | | - 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
* Fix a bug in anyInRnEnvRSimon Peyton Jones2022-08-294-4/+26
| | | | | | | | | | | | | | | This bug was a subtle error in anyInRnEnvR, introduced by commit d4d3fe6e02c0eb2117dbbc9df72ae394edf50f06 Author: Andreas Klebinger <klebinger.andreas@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.
* Use TcRnDiagnostic in GHC.Tc.TyCl.Class (#20117)Giles Anderson2022-08-298-49/+168
| | | | | | | | | | | | The following `TcRnDiagnostic` messages have been introduced: TcRnIllegalHsigDefaultMethods TcRnBadGenericMethod TcRnWarningMinimalDefIncomplete TcRnDefaultMethodForPragmaLacksBinding TcRnIgnoreSpecialisePragmaOnDefMethod TcRnBadMethodErr TcRnNoExplicitAssocTypeOrDefaultDeclaration
* Fix a nasty loop in TidySimon Peyton Jones2022-08-276-71/+124
| | | | | | | | 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]
* Use Solo to avoid retaining the SCE but to avoid performing the substitutionMatthew Pickering2022-08-271-4/+18
| | | | | | | 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.
* Force imposs_deflt_cons in filterAltsMatthew Pickering2022-08-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Avoid retaining bindings via ModGuts held on the stackMatthew Pickering2022-08-272-19/+24
| | | | | | | | 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.
* Revert "Revert "Refactor SpecConstr to use treat bindings uniformly""Matthew Pickering2022-08-271-263/+259
| | | | | | | | 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
* Improve SpecConstr for evalsSimon Peyton Jones2022-08-277-15/+121
| | | | | | | | | | | | | | | | | | 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.
* boot: cleanup legacy argsCheng Shao2022-08-262-9/+1
| | | | | Cleanup legacy boot script args, following removal of the legacy make build system.
* Remove label style from printing contextKrzysztof Gogolewski2022-08-2627-180/+179
| | | | | | | | | | | | 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).
* Pmc: consider any 2 dicts of the same type equalsheaf2022-08-266-15/+128
| | | | | | | | | | | | | | | | | | | | 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
* Fix redundant importKrzysztof Gogolewski2022-08-251-2/+2
| | | | | This fixes a build error on x86_64-linux-alpine3_12-validate. See the function 'loadExternalPlugins' defined in this file.
* Add since annotations and changelog entriesHarry Garrood2022-08-252-0/+5
|
* Add inits1 and tails1 to Data.List.NonEmptyHarry Garrood2022-08-253-2/+96
| | | | See https://github.com/haskell/core-libraries-committee/issues/67
* compiler: Drop comment references to makeBen Gamari2022-08-251-25/+8
|
* Drop mk/{build,install,config}.mk.inBen Gamari2022-08-259-1166/+6
|
* Drop mkdirhierBen Gamari2022-08-253-21/+0
| | | | This is only used by nofib's dead `dist` target
* Drop hc-build scriptBen Gamari2022-08-251-112/+0
| | | | | This has not worked for many, many years and relied on the now-removed `make`-based build system.
* Remove testsuite/tests/perf/haddock/.gitignoreBen Gamari2022-08-251-2/+0
| | | | | | As noted in #16802, this is no longer needed. Closes #16802.
* Drop make build systemBen Gamari2022-08-25108-8438/+40
| | | | | | | | | | | Here we at long last remove the `make`-based build system, it having been replaced with the Shake-based Hadrian build system. Users are encouraged to refer to the documentation in `hadrian/doc` and this [1] blog post for details on using Hadrian. Closes #17527. [1] https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html
* gitlab-ci: Drop make build validation jobsBen Gamari2022-08-252-59/+0
| | | | In preparation for removal of the `make`-based build system
* validate: Drop --legacy flagBen Gamari2022-08-251-196/+101
| | | | In preparation for removal of the legacy `make`-based build system.
* hadrian: Fix whitespaceBen Gamari2022-08-251-33/+32
| | | | Previously this region of Settings.Packages was incorrectly indented.
* Scrub some partiality in `CommonBlockElim`.M Farkas-Dyck2022-08-251-10/+9
|
* upload_ghc_libs: Add means of passing Hackage credentialsBen Gamari2022-08-251-16/+23
|
* Fix arityType: -fpedantic-bottoms, join points, etcwip/T21694aSimon Peyton Jones2022-08-2526-492/+3359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR fixes #21694, #21755. It also makes sure that #21948 and fix to #21694. * For #21694 the underlying problem was that we were calling arityType on an expression that had free join points. This is a Bad Bad Idea. See Note [No free join points in arityType]. * To make "no free join points in arityType" work out I had to avoid trying to use eta-expansion for runRW#. This entailed a few changes in the Simplifier's treatment of runRW#. See GHC.Core.Opt.Simplify.Iteration Note [No eta-expansion in runRW#] * I also made andArityType work correctly with -fpedantic-bottoms; see Note [Combining case branches: andWithTail]. * Rewrote Note [Combining case branches: optimistic one-shot-ness] * arityType previously treated join points differently to other let-bindings. This patch makes them unform; arityType analyses the RHS of all bindings to get its ArityType, and extends am_sigs. I realised that, now we have am_sigs giving the ArityType for let-bound Ids, we don't need the (pre-dating) special code in arityType for join points. But instead we need to extend the env for Rec bindings, which weren't doing before. More uniform now. See Note [arityType for let-bindings]. This meant we could get rid of ae_joins, and in fact get rid of EtaExpandArity altogether. Simpler. * And finally, it was the strange treatment of join-point Ids in arityType (involving a fake ABot type) that led to a serious bug: #21755. Fixed by this refactoring, which treats them uniformly; but without breaking #18328. In fact, the arity for recursive join bindings is pretty tricky; see the long Note [Arity for recursive join bindings] in GHC.Core.Opt.Simplify.Utils. That led to more refactoring, including deciding that an Id could have an Arity that is bigger than its JoinArity; see Note [Invariants on join points], item 2(b) in GHC.Core * Make sure that the "demand threshold" for join points in DmdAnal is no bigger than the join-arity. In GHC.Core.Opt.DmdAnal see Note [Demand signatures are computed for a threshold arity based on idArity] * I moved GHC.Core.Utils.exprIsDeadEnd into GHC.Core.Opt.Arity, where it more properly belongs. * Remove an old, redundant hack in FloatOut. The old Note was Note [Bottoming floats: eta expansion] in GHC.Core.Opt.SetLevels. Compile time improves very slightly on average: Metrics: compile_time/bytes allocated --------------------------------------------------------------------------------------- T18223(normal) ghc/alloc 725,808,720 747,839,216 +3.0% BAD T6048(optasm) ghc/alloc 105,006,104 101,599,472 -3.2% GOOD geo. mean -0.2% minimum -3.2% maximum +3.0% For some reason Windows was better T10421(normal) ghc/alloc 125,888,360 124,129,168 -1.4% GOOD T18140(normal) ghc/alloc 85,974,520 83,884,224 -2.4% GOOD T18698b(normal) ghc/alloc 236,764,568 234,077,288 -1.1% GOOD T18923(normal) ghc/alloc 75,660,528 73,994,512 -2.2% GOOD T6048(optasm) ghc/alloc 112,232,512 108,182,520 -3.6% GOOD geo. mean -0.6% I had a quick look at T18223 but it is knee deep in coercions and the size of everything looks similar before and after. I decided to accept that 3% increase in exchange for goodness elsewhere. Metric Decrease: T10421 T18140 T18698b T18923 T6048 Metric Increase: T18223
* rts: Consistently use MiB in stats outputBen Gamari2022-08-241-1/+1
| | | | Previously we would say `MB` even where we meant `MiB`.
* driver: don't actually merge objects when ar -L worksCheng Shao2022-08-241-1/+1
|
* Unbreak Haddock comments in `GHC.Core.Opt.WorkWrap.Utils`.M Farkas-Dyck2022-08-241-13/+12
| | | | Closes #22092.
* hadrian: Don't duplicate binaries on installationBen Gamari2022-08-221-1/+5
| | | | | | | Previously we used `install` on symbolic links, which ended up copying the target file rather than installing a symbolic link. Fixes #22062.
* Updated the changelogMario Blažević2022-08-221-0/+5
|
* Test for issue #21942Mario Blažević2022-08-223-0/+10
|
* Fix and test for issue #21723Mario Blažević2022-08-224-12/+26
|
* Added pprType with precedence argument, as a prerequisite to fix issues ↵Mario Blažević2022-08-225-76/+80
| | | | | | | | | | | #21723 and #21942. * refines the precedence levels, adding `qualPrec` and `funPrec` to better control parenthesization * `pprParendType`, `pprFunArgType`, and `instance Ppr Type` all just call `pprType` with proper precedence * `ParensT` constructor is now always printed parenthesized * adds the precedence argument to `pprTyApp` as well, as it needs to keep track and pass it down * using `>=` instead of former `>` to match the Core type printing logic * some test outputs have changed, losing extraneous parentheses
* hadrian: Fix bootstrapping with ghc-9.4Matthew Pickering2022-08-211-0/+1
| | | | | | | | | | | The error was that we were trying to link together containers from boot package library (which depends template-haskell in boot package library) template-haskell from in-tree package database So the fix is to build containers in stage0 (and link against template-haskell built in stage0). Fixes #21981
* Recognize file-header pragmas in GHCi (#21507)MorrowM2022-08-215-0/+40
|
* 19217 Implicitly quantify type variables in :kind commandSasha Bogicevic2022-08-195-6/+24
|
* Print constraints in quotes (#21167)Swann Moreau2022-08-19191-641/+643
| | | | | | | This patch improves the uniformity of error message formatting by printing constraints in quotes, as we do for types. Fix #21167
* Fix #22048 where we failed to drop rules for -fomit-interface-pragmas.Andreas Klebinger2022-08-193-1/+14
| | | | Now we also filter the local rules (again) which fixes the issue.
* tc: warn about lazy annotations on unlifted arguments (fixes #21951)Zachary Wood2022-08-198-0/+57
|
* Revert "Refactor SpecConstr to use treat bindings uniformly"Matthew Pickering2022-08-191-260/+264
| | | | | | | | | | This reverts commit 415468fef8a3e9181b7eca86de0e05c0cce31729. This refactoring introduced quite a severe residency regression (900MB live from 650MB live when compiling mmark), see #21993 for a reproducer and more discussion. Ticket #21993
* haddock docs: Fix links from identifiers to dependent packagesMatthew Pickering2022-08-192-6/+5
| | | | | | | | | When implementing the base_url changes I made the pretty bad mistake of zipping together two lists which were in different orders. The simpler thing to do is just modify `haddockDependencies` to also return the package identifier so that everything stays in sync. Fixes #22001
* Force unfoldings when they are cleaned-up in Tidy and CorePrepMatthew Pickering2022-08-192-3/+7
| | | | | | | | If these thunks are not forced then the entire unfolding for the binding is live throughout the whole of CodeGen despite the fact it should have been discarded. Fixes #22071
* Force `getOccFS bndr` to avoid retaining reference to Bndr.Matthew Pickering2022-08-191-2/+5
| | | | This is another symptom of #19619