summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Zonk the returned kind in tcFamTyPatswip/T19250Simon Peyton Jones2021-01-283-0/+44
| | | | | | The motivation is given in Note [tcFamTyPats: zonking the result kind]. Fixes #19250 -- the fix is easy.
* Fix strictness in TyCo.Tidy (#14738)Sylvain Henry2021-01-281-18/+38
| | | | | | | | | Metric Decrease: T12545 T14683 T16577 T5321Fun T5642
* Fix code formatting in `HasCallStack` sectionDenis Frezzato2021-01-281-1/+1
|
* Bump haddock submoduleJoachim Breitner2021-01-281-0/+0
| | | | | | | | | | | | | | | | | | | to get this commit: commit 0952d94a2e30a3e7cddbede811b15fa70f7b9462 (HEAD) Author: Joachim Breitner <mail@joachim-breitner.de> Date: Tue Jan 19 11:39:38 2021 +0100 Make haddock more robust to changes to the `Language` data type With the introduction of GHC2021, the `Languages` data type in GHC will grow. In preparation of that (and to avoid changing haddock with each new language), this change makes the code handle extensions to that data type gracefully. (cherry picked from commit c341dd7c9c3fc5ebc83a2d577c5a726f3eb152a5) This can go in as preparation for !4853
* Reduce default test verbosityMatthew Pickering2021-01-284-4/+12
|
* SimplM: Create uniques via IO instead of threadingAndreas Klebinger2021-01-285-70/+147
|
* Use validate flavour for all CI builds.Andreas Klebinger2021-01-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also means we compile GHC with -O1 instead of -O2 for some platforms for CI. As a result a lot of test metrics got worse which we now have to accept. ------------------------- Metric Increase: ManyAlternatives ManyConstructors MultiLayerModules Naperian T10421 T12150 T12227 T12234 T12425 T12545 T12707 T13035 T13253 T13253-spj T13701 T13379 T13719 T14697 T16577 T18282 T18698a T18698b T1969 T3064 T3294 T4801 T5205 T5321FD T5321Fun T5631 T6048 T783 T9020 T9203 T9233 T9630 T9872a T9872b T9872c T9872d T9961 haddock.Cabal haddock.base haddock.compiler parsing001 T5642 WWRec T14683 T15164 T18304 T18923 -------------------------
* rts: sm/GC.c: make num_idle unsignedAndreas Klebinger2021-01-281-1/+1
| | | | | We compare it to n_gc_idle_threads which is unsigned as well. So make both signed to avoid a warning.
* Implement #18519Koz Ross2021-01-271-0/+38
|
* Respect $AR in configure scriptCheng Shao2021-01-271-1/+2
| | | | | | | | | Previously, the configure script doesn't respect $AR. This causes the nixpkgs GHC to capture "ar" instead of the absolute nix store path of ar in the global config. The original patch comes from https://github.com/input-output-hk/haskell.nix/blob/master/overlays/patches/ghc/respect-ar-path.patch.
* Fix doctest examples in Data.BitsOleg Grenrus2021-01-271-3/+7
|
* Fix spurious failures of T16916 on CI (#16966)Sylvain Henry2021-01-273-13/+46
| | | | | | | | | | | | | * disable idle GC which has a big impact on time measures * use average measures (before and after event registration) * use warmup measures (for some reason the first measure of a batch seems to be often quite different from the others) * drop the division by monotonic clock time: this clock is impacted by the load of the runner. We only want to measure the time spent in the RTS while the mutator is idle so I don't understand why it was used.
* hadrian: Fix `lookupInPath` on Windows (#19249)Sebastian Graf2021-01-271-5/+7
| | | | | | By querying the PATH variable explicitly via `getSearchPath`, we can work around the special behavior of `findExecutable` on Windows, where it also searches in System32. Fixes #19249.
* Remove some redundant validity checks.Richard Eisenberg2021-01-2740-218/+114
| | | | | | | | | | | | This commit also consolidates documentation in the user manual around UndecidableSuperClasses, UndecidableInstances, and FlexibleContexts. Close #19186. Close #19187. Test case: typecheck/should_compile/T19186, typecheck/should_fail/T19187{,a}
* Add regression test for #11228Adam Gundry2021-01-273-0/+15
|
* Add a section about failable patterns in the GHC user's guideHécate2021-01-271-0/+31
|
* Remove -XMonadFailDesugaring referencesHécate2021-01-277-33/+7
|
* Add instances for GHC.Tuple.SoloBen Gamari2021-01-2728-22/+125
| | | | | | | | | | | | | | | The `Applicative` instance is the most important one (for array/vector/sequence indexing purposes), but it deserves all the usual ones. T12545 does silly 1% wibbles both ways, it seems, maybe depending on architecture. Metric Increase: T12545 Metric Decrease: T12545
* Add additional context to :doc output (#19055)Aaron Allen2021-01-275-9/+96
| | | | | | With this change, the type/kind of an object as well as it's category and definition site are added to the output of the :doc command for each object matching the argument string.
* Deprecate -h flagMatthew Pickering2021-01-276-8/+17
| | | | | | | | | | It is confusing that it defaults to two different things depending on whether we are in the profiling way or not. Use -hc if you have a profiling build Use -hT if you have a normal build Fixes #19031
* Remove ioManager{Start,Die,Wakeup} from IOManager.hDuncan Coutts2021-01-256-15/+34
| | | | | | | | | They are not part of the IOManager interface used within the rest of the RTS. They are the part of the interface of specific I/O manager implementations. They are no longer called directly elsewhere in the RTS, and are now only called by the dispatch functions in IOManager.c
* Add a common wakeupIOManager hookDuncan Coutts2021-01-253-1/+33
| | | | | | | Use in the scheduler in threaded mode. Replaces the direct call to ioManagerWakeup which are part of specific I/O manager implementations.
* Replace a ioManagerDie call with stopIOManagerDuncan Coutts2021-01-252-1/+14
| | | | | The latter is the proper hook defined in IOManager.h. The former is part of a specific I/O manager implementation (the threaded unix one).
* Replace a direct call to ioManagerStartCap with a new hookDuncan Coutts2021-01-253-3/+48
| | | | | | | | | | Replace a direct call to ioManagerStartCap in the forkProcess in Schedule.c with a new hook initIOManagerAfterFork in IOManager. This replaces a direct hook in the scheduler from the a single I/O manager impl (the threaded unix one) with a generic hook. Add some commentrary on opportunities for future rationalisation.
* Move hooks for I/O manager startup / shutdown into IOManager.{c,h}Duncan Coutts2021-01-253-20/+88
|
* Move ioManager{Start,Wakeup,Die} to internal IOManager.hDuncan Coutts2021-01-257-14/+16
| | | | | | | | Move them from the external IOInterface.h to the internal IOManager.h. The functions are all in fact internal. They are not used from the base library at all. Remove ioManagerWakeup as an exported symbol. It is not used elsewhere.
* Move setIOManagerControlFd from Capability.c to IOManager.cDuncan Coutts2021-01-252-17/+17
| | | | | This is a better home for it. It is not really an aspect of capabilities. It is specific to one of the I/O manager impls.
* Start to centralise the I/O manager hooks from other bits of the RTSDuncan Coutts2021-01-253-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | It is currently rather difficult to understand or work with the various I/O manager implementations. This is for a few reasons: 1. They do not have a clear or common API. There are some common function names, but a lot of things just get called directly. 2. They have hooks into many other parts of the RTS where they get called from. 3. There is a _lot_ of CPP involved, both THREADED_RTS vs !THREADED_RTS and also mingw32_HOST_OS vs !mingw32_HOST_OS. This doesn't really identify the I/O manager implementation. 4. They have data structures with unclear ownership, or that are co-owned with other components like the scheduler. Some data structures are used by multiple I/O managers. One thing that would help is if the interface between the I/O managers and the rest of the RTS was clearer, even if it was not completely uniform. Centralising it would make it easier to see how to reduce any unnecessary diversity in the interfaces. This patch makes a start by creating a new IOManager.{h,c} module. It is initially empty, but we will move things into it in subsequent patches.
* Rename includes/rts/IOManager.h to IOInterface.hDuncan Coutts2021-01-255-4/+4
| | | | | | | | | | | | | | | | | | | | | Naming is hard. Where we want to get to is to have a clear internal and external API for the IO manager within the RTS. What we have right now is just the external API (used in base for the Haskell side of the threaded IO manager impls) living in includes/rts/IOManager.h. We want to add a clear RTS internal API, which really ought to live in rts/IOManager.h. Several people think it's too confusing to have both: * includes/rts/IOManager.h for the external API * rts/IOManager.h for the internal API So the plan is to add rts/IOManager.{h,c} as the internal parts, and rename the external part to be includes/rts/IOInterface.h. It is admittidly not great to have .h files in includes/rts/ called "interface" since by definition, every .h fle under includes/ is an interface! Alternative naming scheme suggestions welcome!
* Move win32/IOManager to win32/MIOManagerDuncan Coutts2021-01-257-7/+7
| | | | | It is only for MIO, and we want to use the generic name IOManager for the name of the common parts of the interface and dispatch.
* CoreToStg.Prep: Speculative evaluationSebastian Graf2021-01-231-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From `Note [Speculative evaluation]`: Since call-by-value is much cheaper than call-by-need, we case-bind arguments that are either 1. Strictly evaluated anyway, according to the StrictSig of the callee, or 2. ok-for-spec, according to 'exprOkForSpeculation' While (1) is a no-brainer and always beneficial, (2) is a bit more subtle, as the careful haddock for 'exprOkForSpeculation' points out. Still, by case-binding the argument we don't need to allocate a thunk for it, whose closure must be retained as long as the callee might evaluate it. And if it is evaluated on most code paths anyway, we get to turn the unknown eval in the callee into a known call at the call site. NoFib Results: ``` -------------------------------------------------------------------------------- Program Allocs Instrs -------------------------------------------------------------------------------- ansi -9.4% -10.4% maillist -0.1% -0.1% paraffins -0.7% -0.5% scc -0.0% +0.1% treejoin -0.0% -0.1% -------------------------------------------------------------------------------- Min -9.4% -10.4% Max 0.0% +0.1% Geometric Mean -0.1% -0.1% ``` Fixes #19224.
* Track the dependencies of `GHC.Hs.Expr.Types`John Ericson2021-01-239-57/+326
| | | | | | Thery is still, in my view, far too numerous, but I believe this won't be too hard to improve upon. At the very lease, we can always add more extension points!
* Separate AST from GhcPass (#18936)John Ericson2021-01-2337-6201/+7287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---------------- What: There are two splits. The first spit is: - `Language.Haskell.Syntax.Extension` - `GHC.Hs.Extension` where the former now just contains helpers like `NoExtCon` and all the families, and the latter is everything having to do with `GhcPass`. The second split is: - `Language.Haskell.Syntax.<mod>` - `GHC.Hs.<mod>` Where the former contains all the data definitions, and the few helpers that don't use `GhcPass`, and the latter contains everything else. The second modules also reexport the former. ---------------- Why: See the issue for more details, but in short answer is we're trying to grasp at the modularity TTG is supposed to offer, after a long time of mainly just getting the safety benefits of more complete pattern matching on the AST. Now, we have an AST datatype which, without `GhcPass` is decently stripped of GHC-specific concerns. Whereas before, not was it GHC-specific, it was aware of all the GHC phases despite the parameterization, with the instances and parametric data structure side-by-side. For what it's worth there are also some smaller, imminent benefits: - The latter change also splits a strongly connected component in two, since none of the `Language.Haskell.Syntax.*` modules import the older ones. - A few TTG violations (Using GhcPass directly in the AST) in `Expr` are now more explicitly accounted for with new type families to provide the necessary indirection. ----------------- Future work: - I don't see why all the type families should live in `Language.Haskell.Syntax.Extension`. That seems anti-modular for little benefit. All the ones used just once can be moved next to the AST type they serve as an extension point for. - Decide what to do with the `Outputable` instances. Some of these are no orphans because they referred to `GhcPass`, and had to be moved. I think the types could be generalized so they don't refer to `GhcPass` and therefore can be moved back, but having gotten flak for increasing the size and complexity types when generalizing before, I did *not* want to do this. - We should triage the remaining contents of `GHC.Hs.<mod>`. The renaming helpers are somewhat odd for needing `GhcPass`. We might consider if they are a) in fact only needed by one phase b) can be generalized to be non-GhcPass-specific (e.g. take a callback rather than GADT-match with `IsPass`) and then they can live in `Language.Haskell.Syntax.<mod>`. For more details, see https://gitlab.haskell.org/ghc/ghc/-/wikis/implementing-trees-that-grow Bumps Haddock submodule
* Add _validatebuild to .gitignoreCheng Shao2021-01-231-0/+1
| | | | [ci skip]
* Bignum: add Natural constant folding rules (#15821)Sylvain Henry2021-01-2322-523/+1056
| | | | | | | | | | | | | | | | | | | * Implement constant folding rules for Natural (similar to Integer ones) * Add mkCoreUbxSum helper in GHC.Core.Make * Remove naturalTo/FromInt We now only provide `naturalTo/FromWord` as the semantics is clear (truncate/zero-extend). For Int we have to deal with negative numbers (throw an exception? convert to Word beforehand?) so we leave the decision about what to do to the caller. Moreover, now that we have sized types (Int8#, Int16#, ..., Word8#, etc.) there is no reason to bless `Int#` more than `Int8#` or `Word8#` (for example). * Replaced a few `()` with `(# #)`
* FiniteBits for some newtype instances, notes on whyKoz Ross2021-01-231-7/+25
|
* Add headers for Data.Bits documentationKoz Ross2021-01-231-2/+3
|
* Add @since annotations for And, Ior, Xor, Iff type class instancesKoz Ross2021-01-231-9/+45
|
* Implement #15993Koz Ross2021-01-236-648/+800
|
* Make matchableGivens more reliably correct.Richard Eisenberg2021-01-2318-177/+282
| | | | | | | | | | | | | | | | | | | | | | | This has two fixes: 1. Take TyVarTvs into account in matchableGivens. This fixes #19106. 2. Don't allow unifying alpha ~ Maybe alpha. This fixes #19107. This patch also removes a redundant Note and redirects references to a better replacement. Also some refactoring/improvements around the BindFun in the pure unifier, which now can take the RHS type into account. Close #19106. Close #19107. Test case: partial-sigs/should_compile/T19106, typecheck/should_compile/T19107
* Remove legacy comment in validate scriptCheng Shao2021-01-221-3/+0
| | | | | The validate flavour is already defined and used in hadrian, so this legacy comment should be removed.
* Make DmdAnalOpts a newtypeAndreas Klebinger2021-01-222-3/+3
|
* Force inlining of deRefStablePtr to silence warningsAndreas Klebinger2021-01-221-2/+2
|
* Enhance nested TransCo pretty-printingSylvain Henry2021-01-221-2/+5
| | | | | | | | | | | | | | | | Nested TransCo were printed with a lot of indentation, e.g.: `cast` (Sub (Sym (Foo.D:R:Index[0] <Bool>_N <'[]>_N)) ; ((Index (Sym (SubDef (<1>_N, <1>_N))) <'[Bool]>_N)_R ; ... With this patch we print them as follows: `cast` (Sub (Sym (Foo.D:R:Index[0] <Bool>_N <'[]>_N)) ; (Index (Sym (SubDef (<1>_N, <1>_N))) <'[Bool]>_N)_R ; Sub (Sym (Foo.D:R:Index[1] <1>_N <Int>_N <'[Bool]>_N)) ; (Index (Sym (SubDef (<2>_N, <1>_N))) <'[Int, Bool]>_N)_R
* Optimize some rts_mk/rts_get functions in RtsAPI.cCheng Shao2021-01-221-26/+43
| | | | | | | | | - All rts_mk functions return the tagged closure address - rts_mkChar/rts_mkInt avoid allocation when the argument is within the CHARLIKE/INTLIKE range - rts_getBool avoids a memory load by checking the closure tag - In rts_mkInt64/rts_mkWord64, allocated closure payload size is either 1 or 2 words depending on target architecture word size
* CmmToC: Fix translation of Cmm literals to word sized literalsStefan Schulze Frielinghaus2021-01-221-5/+7
| | | | | For big-endian machines remove the byte swap in the non-recursive call of goSubWord since the integer is already in proper format.
* Change replicateM doctest exampleOleg Grenrus2021-01-221-4/+13
|
* gitlab-ci: Fix perf metric pushingBen Gamari2021-01-221-1/+1
| | | | | | Previously we would inexplicably append the key to id_rsa. Fixes #19225.
* LLVM: fix sized shift primops (#19215)Sylvain Henry2021-01-221-10/+20
| | | | | Ensure that shift amount parameter has the same type as the parameter to shift.
* Core: introduce Alt/AnnAlt/IfaceAlt datatypesSylvain Henry2021-01-2254-266/+281
| | | | | | Alt, AnnAlt and IfaceAlt were using triples. This patch makes them use dedicated types so that we can try to make some fields strict (for example) in the future.