summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* IfaceToType: Ensure that IfaceTyConInfo is sharedwip/T19194Ben Gamari2021-03-163-9/+18
| | | | | | | | | | | | | | | | In #19194 mpickering detailed that there are a LOT of allocations of IfaceTyConInfo: There are just two main cases: IfaceTyConInfo IsPromoted IfaceNormalTyCon and IfaceTyConInfo NotPromoted IfaceNormalTyCon. These should be made into CAFs and shared. From my analysis, the most common case is IfaceTyConInfo NotPromoted IfaceNormalTyCon (53 000) then IfaceTyConInfo IsPromoted IfaceNormalTyCon (28 000). This patch makes it so these are properly shared by using a smart constructor. Fixes #19194.
* Test chained record construction/update/accessVladislav Zavialov2021-03-153-0/+18
| | | | | | | | | | | According to the proposal, we have the following equivalence: e{lbl1 = val1}.val2 == (e{lbl1 = val1}).val2 This is a matter of parsing. Record construction/update must have the same precedence as dot access. Add a test case to ensure this.
* Fix record dot precedence (#19521)Vladislav Zavialov2021-03-154-21/+20
| | | | | By moving the handling of TIGHT_INFIX_PROJ to the correct place, we can remove the isGetField hack and fix a bug at the same time.
* Document the interaction between ScopedTypeVariables and ↵Ryan Scott2021-03-151-0/+31
| | | | | | | | | StandaloneKindSignatures This documents a limitation of `StandaloneKindSignatures`—namely, that it does not bring type variables bound by an outermost `forall` into scope over a type-level declaration—in the GHC User's Guide. See #19498 for more discussion.
* Compute length only once in foldBalSylvain Henry2021-03-141-4/+11
|
* Write explicit IOEnv's Functor and MonadIO instances (#18202)Sylvain Henry2021-03-141-2/+8
|
* Make traceHeapEventInfo an init eventMatthew Pickering2021-03-141-6/+18
| | | | This means it will be reposted everytime the eventlog is started.
* Pmc: Consider Required Constraints when guessing PatSyn arg types (#19475)Sebastian Graf2021-03-148-130/+236
| | | | | | | | | | | | | | | | | | | | | | This patch makes `guessConLikeUnivTyArgsFromResTy` consider required Thetas of PatSynCons, by treating them as Wanted constraints to be discharged with the constraints from the Nabla's TyState and saying "does not match the match type" if the Wanted constraints are unsoluble. It calls out into a new function `GHC.Tc.Solver.tcCheckWanteds` to do so. In pushing the failure logic around call sites of `initTcDsForSolver` inside it by panicking, I realised that there was a bunch of dead code surrounding `pmTopMoraliseType`: I was successfully able to delete the `NoChange` data constructor of `TopNormaliseTypeResult`. The details are in `Note [Matching against a ConLike result type]` and `Note [Instantiating a ConLike]. The regression test is in `T19475`. It's pretty much a fork of `T14422` at the moment. Co-authored-by: Cale Gibbard <cgibbard@gmail.com>
* Correct module name in `-fprof-callers` documentationMatthew Pickering2021-03-141-1/+1
|
* Implement the UnliftedDatatypes extensionSebastian Graf2021-03-1439-163/+719
| | | | | | | | | | | | | | | | | | GHC Proposal: 0265-unlifted-datatypes.rst Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265 Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523 Implementation Details: Note [Implementation of UnliftedDatatypes] This patch introduces the `UnliftedDatatypes` extension. When this extension is enabled, GHC relaxes the restrictions around what result kinds are allowed in data declarations. This allows data types for which an unlifted or levity-polymorphic result kind is inferred. The most significant changes are in `GHC.Tc.TyCl`, where `Note [Implementation of UnliftedDatatypes]` describes the details of the implementation. Fixes #19523.
* Allow perf-nofib to failwip/angerman/fasterMoritz Angermann2021-03-141-0/+3
|
* Force eol=lf; to prevent windows breakage.Moritz Angermann2021-03-131-1/+1
|
* bump submodule nofibMoritz Angermann2021-03-131-0/+0
|
* Shorten the build pipelineMoritz Angermann2021-03-131-6/+3
|
* Update win32 submoduleTamar Christina2021-03-121-0/+0
|
* testsuite: Update Win32 test output for GHC2021GHC GitLab CI2021-03-115-28/+5
| | | | Fixes the Windows CI jobs. Requires update of the Win32 submodule.
* Ignore breakpoint for a specified number of iterations. (#19157)Roland Senn2021-03-1015-109/+281
| | | | | | | | | | | | | | | | * Implement new debugger command `:ignore` to set an `ignore count` for a specified breakpoint. * Allow new optional parameter on `:continue` command to set an `ignore count` for the current breakpoint. * In the Interpreter replace the current `Word8` BreakArray with an `Int` array. * Change semantics of values in `BreakArray` to: n < 0 : Breakpoint is disabled. n == 0 : Breakpoint is enabled. n > 0 : Breakpoint is enabled, but ignore next `n` iterations. * Rewrite `:enable`/`:disable` processing as a special case of `:ignore`. * Remove references to `BreakArray` from `ghc/UI.hs`.
* Use GHC2021 as default languageJoachim Breitner2021-03-10855-1246/+1774
|
* Introduce GHC2021 languageJoachim Breitner2021-03-106-25/+144
| | | | | | This adds support for -XGHC2021, as described in Proposal 0380 [1]. [1] https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst
* template-haskell: Add putDoc, getDoc, withDecDoc and friendsLuke Lau2021-03-1032-52/+968
| | | | | | | | | | | | | | | | | | | | | | | This adds two new methods to the Quasi class, putDoc and getDoc. They allow Haddock documentation to be added to declarations, module headers, function arguments and class/type family instances, as well as looked up. It works by building up a map of names to attach pieces of documentation to, which are then added in the extractDocs function in GHC.HsToCore.Docs. However because these template haskell names need to be resolved to GHC names at the time they are added, putDoc cannot directly add documentation to declarations that are currently being spliced. To remedy this, withDecDoc/withDecsDoc wraps the operation with addModFinalizer, and provides a more ergonomic interface for doing so. Similarly, the funD_doc, dataD_doc etc. combinators provide a more ergonomic interface for documenting functions and their arguments simultaneously. This also changes ArgDocMap to use an IntMap rather than an Map Int, for efficiency. Part of the work towards #5467
* Bump bytestring submodule to 0.11.1.0Ben Gamari2021-03-1018-16/+20
|
* FastString: Use FastMutInt instead of IORef IntBen Gamari2021-03-101-12/+13
| | | | This saves at least one I# allocation per FastString.
* FastMutInt: Introduce atomicFetchAddFastMutIntBen Gamari2021-03-101-7/+13
| | | | This will be needed by FastString.
* FastMutInt: Ensure that newFastMutInt initializes valueBen Gamari2021-03-107-38/+31
| | | | Updates haddock submodule.
* FastMutInt: Drop FastMutPtrBen Gamari2021-03-101-25/+1
| | | | This appears to be unused.
* Simplify shadowing of DuplicateRecordFields in GHCi (fixes #19314)Adam Gundry2021-03-108-40/+51
| | | | | | | Previously, defining fields with DuplicateRecordFields in GHCi lead to strange shadowing behaviour, whereby fields would (accidentally) not shadow other fields. This simplifies things so that fields are shadowed in the same way whether or not DuplicateRecordFields is enabled.
* Do not remove shadowed record selectors from interactive context (fixes #19322)Adam Gundry2021-03-104-1/+11
|
* rts: Gradually return retained memory to the OSMatthew Pickering2021-03-1010-20/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related to #19381 #19359 #14702 After a spike in memory usage we have been conservative about returning allocated blocks to the OS in case we are still allocating a lot and would end up just reallocating them. The result of this was that up to 4 * live_bytes of blocks would be retained once they were allocated even if memory usage ended up a lot lower. For a heap of size ~1.5G, this would result in OS memory reporting 6G which is both misleading and worrying for users. In long-lived server applications this results in consistent high memory usage when the live data size is much more reasonable (for example ghcide) Therefore we have a new (2021) strategy which starts by retaining up to 4 * live_bytes of blocks before gradually returning uneeded memory back to the OS on subsequent major GCs which are NOT caused by a heap overflow. Each major GC which is NOT caused by heap overflow increases the consec_idle_gcs counter and the amount of memory which is retained is inversely proportional to this number. By default the excess memory retained is oldGenFactor (controlled by -F) / 2 ^ (consec_idle_gcs * returnDecayFactor) On a major GC caused by a heap overflow, the `consec_idle_gcs` variable is reset to 0 (as we could continue to allocate more, so retaining all the memory might make sense). Therefore setting bigger values for `-Fd` makes the rate at which memory is returned slower. Smaller values make it get returned faster. Setting `-Fd0` disables the memory return completely, which is the behaviour of older GHC versions. The default is `-Fd4` which results in the following scaling: > mapM print [(x, 1/ (2**(x / 4))) | x <- [1 :: Double ..20]] (1.0,0.8408964152537146) (2.0,0.7071067811865475) (3.0,0.5946035575013605) (4.0,0.5) (5.0,0.4204482076268573) (6.0,0.35355339059327373) (7.0,0.29730177875068026) (8.0,0.25) (9.0,0.21022410381342865) (10.0,0.17677669529663687) (11.0,0.14865088937534013) (12.0,0.125) (13.0,0.10511205190671433) (14.0,8.838834764831843e-2) (15.0,7.432544468767006e-2) (16.0,6.25e-2) (17.0,5.255602595335716e-2) (18.0,4.4194173824159216e-2) (19.0,3.716272234383503e-2) (20.0,3.125e-2) So after 13 consecutive GCs only 0.1 of the maximum memory used will be retained. Further to this decay factor, the amount of memory we attempt to retain is also influenced by the GC strategy for the oldest generation. If we are using a copying strategy then we will need at least 2 * live_bytes for copying to take place, so we always keep that much. If using compacting or nonmoving then we need a lower number, so we just retain at least `1.2 * live_bytes` for some protection. In future we might want to make this behaviour more aggressive, some relevant literature is > Ulan Degenbaev, Jochen Eisinger, Manfred Ernst, Ross McIlroy, and Hannes Payer. 2016. Idle time garbage collection scheduling. SIGPLAN Not. 51, 6 (June 2016), 570–583. DOI:https://doi.org/10.1145/2980983.2908106 which describes the "memory reducer" in the V8 javascript engine which on an idle collection immediately returns as much memory as possible.
* Location for tuple section pattern error (#19504)Vladislav Zavialov2021-03-094-1/+9
| | | | | This fixes a regression that led to loss of location information in error messages about the use of tuple sections in patterns.
* Fix some warnings when bootstrapping with GHC 9.0Ryan Scott2021-03-096-6/+6
| | | | | | | | | | | This fixes two classes of warnings that appear when bootstrapping with GHC 9.0: * `ghc-boot.cabal` was using `cabal-version: >=1.22`, which `cabal-install-3.4` now warns about, instead recommending the use of `cabal-version: 1.22`. * Several pattern matches were producing `Pattern match(es) are non-exhaustive` because of incorrect CPP. The pattern-match coverage checker _did_ become smarter in GHC 9.1, however, so I ended up needing to keep the CPP, adjusting them to use `#if __GLASGOW_HASKELL__ < 901` instead.
* Fixes to dealing with the export of mainSimon Peyton Jones2021-03-0947-399/+520
| | | | | | | | | | | | | | | | | | | | It's surprisingly tricky to deal with 'main' (#19397). This patch does quite bit of refactoring do to it right. Well, more-right anyway! The moving parts are documented in GHC.Tc.Module Note [Dealing with main] Some other oddments: * Rename tcRnExports to rnExports; no typechecking here! * rnExports now uses checkNoErrs rather than failIfErrsM; the former fails only if rnExports itself finds errors * Small improvements to tcTyThingCategory, which ultimately weren't important to the patch, but I've retained as a minor improvement.
* Replace Ord TyLit with nonDetCmpTyLit (#19441)Vladislav Zavialov2021-03-092-11/+21
| | | | | | The Ord instance was non-deterministic, but it's easy assume that it is deterministic. In fact, haddock-api used to do exactly that before haddock/7e8c7c3491f3e769368b8e6c767c62a33e996c80
* Add a distclean command to hadrian.Andreas Klebinger2021-03-092-3/+13
| | | | | | | | | Hadrian should behave well and not delete files created by configure with the clean command. With this patch hadrian now deletes the fs/mingw tarballs only with distclean. This fixes #19320. The main impact being that validate won't have to redownload the tarballs when re-run.
* Document operator sections' interaction with subsumptionRyan Scott2021-03-092-0/+19
| | | | | | This resolves #19457 by making a note of breaking changes (introduced in GHC 9.2) to the way that GHC typechecks operator sections where the operator has nested `forall`s or contexts in its type signature.
* Require GHC 8.10 as the minimum compiler for bootstrappingRyan Scott2021-03-0919-95/+32
| | | | | | | Now that GHC 9.0.1 is released, it is time to drop support for bootstrapping with GHC 8.8, as we only support building with the previous two major GHC releases. As an added bonus, this allows us to remove several bits of CPP that are either always true or no longer reachable.
* eventlog: Repost initialisation events when eventlog restartsMatthew Pickering2021-03-085-9/+93
| | | | | | | | | | | | | | | | | | If startEventlog is called after the program has already started running then quite a few useful events are missing from the eventlog because they are only posted when the program starts. This patch adds a mechanism to declare that an event should be reposted everytime the startEventlog function is called. Now in EventLog.c there is a global list of functions called `eventlog_header_funcs` which stores a list of functions which should be called everytime the eventlog starts. When calling `postInitEvent`, the event will not only be immediately posted to the eventlog but also added to the global list. When startEventLog is called, the list is traversed and the events reposted.
* rts: Use a separate free block list for allocatePinnedMatthew Pickering2021-03-086-15/+215
| | | | | | | | | | | The way in which allocatePinned took blocks out of the nursery was leading to horrible fragmentation in some workloads. The strategy now is that a separate free block list is reserved for each capability and blocks are taken from there. When it's empty the global SM lock is taken and a fresh block of size PINNED_EMPTY_SIZE is allocated. Fixes #19481
* DynFlags: move temp file management into HscEnv (#17957)Sylvain Henry2021-03-0822-329/+439
|
* Update changelog and release notes for Data.Type.Ord changeDaniel Winograd-Cort2021-03-082-0/+32
|
* eventlog: Add changelog entry for BLOCKS_SIZE and MEM_RETURNMatthew Pickering2021-03-081-0/+7
|
* eventlog: Add BLOCKS_SIZE eventMatthew Pickering2021-03-086-8/+41
| | | | | | | | | | | | | The BLOCKS_SIZE event reports the size of the currently allocated blocks in bytes. It is like the HEAP_SIZE event, but reports about the blocks rather than megablocks. You can work out the current heap fragmentation by looking at the difference between HEAP_SIZE and BLOCKS_SIZE. Fixes #19357
* eventlog: Add MEM_RETURN event to give information about fragmentationMatthew Pickering2021-03-0810-6/+106
| | | | | | | | | | | | | | See #19357 The event reports the * Current number of megablocks allocated * The number that the RTS thinks it needs * The number is managed to return to the OS When current > need then the difference is returned to the OS, the successful number of returned mblocks is reported by 'returned'. In a fragmented heap current > need but returned < current - need.
* Hadrian: Add powerpc64[le] to supported arch listPeter Trommler2021-03-081-1/+2
| | | | Fixes #19409
* Implement BoxedRep proposalwip/boxed-repBen Gamari2021-03-07107-380/+774
| | | | | | | | | | | | | | | | | | | | | | | This implements the BoxedRep proposal, refactoring the `RuntimeRep` hierarchy from: ```haskell data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ... ``` to ```haskell data RuntimeRep = BoxedRep Levity | ... data Levity = Lifted | Unlifted ``` Updates binary, haddock submodules. Closes #17526. Metric Increase: T12545
* Implement record dot syntaxwip/joachim/bump-haddockShayne Fletcher2021-03-0666-75/+1552
|
* hadrian: Pass -fno-use-rpaths to GHC while linkingBen Gamari2021-03-061-0/+4
| | | | | | | This mirrors the make build system and ensures that we don't end up with references to the build directory in the final executable. Fixes #19485.
* Windows: fix crlf on checkoutSylvain Henry2021-03-061-0/+3
| | | | | Using .gitatttributes, we don't require users to set git's core.autocrlf setting to false on Windows to be able to checkout a working tree.
* Implement riscv64 LLVM backendAndreas Schwab2021-03-0526-11/+347
| | | | This enables a registerised build for the riscv64 architecture.
* Update bounds/hadrian to fix bootstrapping with 9.0.Andreas Klebinger2021-03-054-8/+10
| | | | | | | | | | This fixes #19484. In detail we: * Bump the index-state of hackage. * Require alex-3.2.6, as alex-3.2.5 doesn't build with 9.0. * Allow Cabal-3.4 as 3.2 doesn't build with ghc 9.0. * Allow a newer QuickCheck version that accepts the new base version. * Some code changes to account for Cabal changes.
* Add new driver test for use of outdated .o filesHarry Garrood harry@garrood.me2021-03-057-0/+61
| | | | | | | This is something that's quite important for the correctness of the incremental build system and doesn't appear to be tested currently; this test fails on my hashing branch, whereas all of the other (non-perf) tests pass.