summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* PmCheck: Rewrite inhabitation testwip/T18249Sebastian Graf2020-09-2111-1225/+1210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to produce inhabitants of a pattern-match refinement type Nabla in the checker in at least two different and mostly redundant ways: 1. There was `provideEvidence` (now called `generateInhabitingPatterns`) which is used by `GHC.HsToCore.PmCheck` to produce non-exhaustive patterns, which produces inhabitants of a Nabla as a sub-refinement type where all match variables are instantiated. 2. There also was `ensure{,All}Inhabited` (now called `inhabitationTest`) which worked slightly different, but was whenever new type constraints or negative term constraints were added. See below why `provideEvidence` and `ensureAllInhabited` can't be the same function, the main reason being performance. 3. And last but not least there was the `nonVoid` test, which tested that a given type was inhabited. We did use this for strict fields and -XEmptyCase in the past. The overlap of (3) with (2) was always a major pet peeve of mine. The latter was quite efficient and proven to work for recursive data types, etc, but could not handle negative constraints well (e.g. we often want to know if a *refined* type is empty, such as `{ x:[a] | x /= [] }`). Lower Your Guards suggested that we could get by with just one, by replacing both functions with `inhabitationTest` in this patch. That was only possible by implementing the structure of φ constraints as in the paper, namely the semantics of φ constructor constraints. This has a number of benefits: a. Proper handling of unlifted types and strict fields, fixing #18249, without any code duplication between `GHC.HsToCore.PmCheck.Oracle.instCon` (was `mkOneConFull`) and `GHC.HsToCore.PmCheck.checkGrd`. b. `instCon` can perform the `nonVoid` test (3) simply by emitting unliftedness constraints for strict fields. c. `nonVoid` (3) is thus simply expressed by a call to `inhabitationTest`. d. Similarly, `ensureAllInhabited` (2), which we called after adding type info, now can similarly be expressed as the fuel-based `inhabitationTest`. See the new `Note [Why inhabitationTest doesn't call generateInhabitingPatterns]` why we still have tests (1) and (2). Fixes #18249 and brings nice metric decreases for `T17836` (-76%) and `T17836b` (-46%), as well as `T18478` (-8%) at the cost of a few very minor regressions (< +2%), potentially due to the fact that `generateInhabitingPatterns` does more work to suggest the minimal COMPLETE set. Metric Decrease: T17836 T17836b
* PmCheck - Comments only: Replace /~ by ≁Sebastian Graf2020-09-213-33/+33
|
* Deprecate Data.Semigroup.OptionSimon Jakobi2020-09-193-6/+6
| | | | | | | | | | | | Libraries email: https://mail.haskell.org/pipermail/libraries/2018-April/028724.html GHC issue: https://gitlab.haskell.org/ghc/ghc/issues/15028 Corresponding PRs for deepseq: * https://github.com/haskell/deepseq/pull/55 * https://github.com/haskell/deepseq/pull/57 Bumps the deepseq submodule.
* rts: Refactor unloading of foreign export StablePtrsBen Gamari2020-09-184-37/+50
| | | | | | Previously we would allocate a linked list cell for each foreign export. Now we can avoid this by taking advantage of the fact that they are already broken into groups.
* rts: Refactor foreign export trackingBen Gamari2020-09-189-45/+209
| | | | | | | | | This avoids calling `libc` in the initializers which are responsible for registering foreign exports. We believe this should avoid the corruption observed in #18548. See Note [Tracking foreign exports] in rts/ForeignExports.c for an overview of the new scheme.
* rts/nonmoving: Add missing STM write barrierBen Gamari2020-09-181-0/+3
| | | | | | When updating a TRec for a TVar already part of a transaction we previously neglected to add the old value to the update remembered set. I suspect this was the cause of #18587.
* Bignum: add clamping naturalToWord (fix #18697)Sylvain Henry2020-09-171-0/+8
|
* Remove pprPrec from Outputable (unused)Sylvain Henry2020-09-171-8/+1
|
* Add note about OutputablePSylvain Henry2020-09-171-9/+108
|
* Generalize OutputablePSylvain Henry2020-09-1719-111/+182
| | | | | Add a type parameter for the environment required by OutputableP. It avoids tying Platform with OutputableP.
* Introduce OutputablePSylvain Henry2020-09-1742-700/+777
| | | | | | | | | | | | | | | | | | | | | | | | | Some types need a Platform value to be pretty-printed: CLabel, Cmm types, instructions, etc. Before this patch they had an Outputable instance and the Platform value was obtained via sdocWithDynFlags. It meant that the *renderer* of the SDoc was responsible of passing the appropriate Platform value (e.g. via the DynFlags given to showSDoc). It put the burden of passing the Platform value on the renderer while the generator of the SDoc knows the Platform it is generating the SDoc for and there is no point passing a different Platform at rendering time. With this patch, we introduce a new OutputableP class: class OutputableP a where pdoc :: Platform -> a -> SDoc With this class we still have some polymorphism as we have with `ppr` (i.e. we can use `pdoc` on a variety of types instead of having a dedicated `pprXXX` function for each XXX type). One step closer removing `sdocWithDynFlags` (#10143) and supporting several platforms (#14335).
* Documented '-m' flags for machine specific instruction extensions.Benjamin Maurer2020-09-172-11/+142
| | | | See #18641 'Documenting the Expected Undocumented Flags'
* Parser.y: clarify treatment of @{-# UNPACK #-}Vladislav Zavialov2020-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, we had this parser production: ftype : ... | ftype PREFIX_AT tyarg { ... } And 'tyarg' is defined as follows: tyarg : atype { ... } | unpackedness atype { ... } So one might get the (false) impression that that parser production is intended to parse things like: F @{-# UNPACK #-} X However, the lexer wouldn't produce PREFIX_AT followed by 'unpackedness', as the '@' operator followed by '{-' is not considered prefix. Thus there's no point using 'tyarg' after PREFIX_AT, and a simple 'atype' will suffice: ftype : ... | ftype PREFIX_AT atype { ... } This change has no user-facing consequences. It just makes the grammar a bit more clear.
* CosmeticLeif Metcalf2020-09-171-1/+1
|
* Make Z-encoding comment into a noteLeif Metcalf2020-09-172-2/+4
|
* Bump version to 9.0Ben Gamari2020-09-172-1/+1
| | | | | | Bumps haskeline and haddock submodules. (cherry picked from commit f218cfc92f7b1a1e01190851972bb9a0e0f3c682)
* Bump Win32 submodule to 2.9.0.0Ben Gamari2020-09-178-5/+5
| | | | Also bumps Cabal, directory
* rts/win32: Fix missing #include'sBen Gamari2020-09-172-1/+3
| | | | These slipped through CI.
* Make the 'IsString (Const a b)' instance polykinded on 'b'Cary Robbins2020-09-171-1/+3
|
* Added explicit fixity to (~).HaskellMouse2020-09-177-0/+36
| | | | Solves #18252
* Document IfaceTupleTyRichard Eisenberg2020-09-171-0/+5
|
* Replace deprecated git --recursiveLeif Metcalf2020-09-171-1/+1
| | | | The --recursive flag of git-clone has been replaced by the --recurse-submodules flag since git 1.7.4, released in 2011.
* Do absence analysis on stable unfoldingsSimon Peyton Jones2020-09-176-10/+147
| | | | | | | | | Ticket #18638 showed that Very Bad Things happen if we fail to do absence analysis on stable unfoldings. It's all described in Note [Absence analysis for stable unfoldings and RULES]. I'm a bit surprised this hasn't bitten us before. Fortunately the fix is pretty simple.
* docs: correct haddock referenceAdam Sandberg Eriksson2020-09-161-2/+2
| | | [skip ci]
* Make ghc-boot reexport modules from ghc-boot-thSylvain Henry2020-09-163-2/+8
| | | | | Packages don't have to import both ghc-boot and ghc-boot-th. It makes the dependency graph easier to understand and to refactor.
* Rename ghci flag into internal-interpreterSylvain Henry2020-09-167-21/+22
| | | | | "ghci" as a flag name was confusing because it really enables the internal-interpreter. Even the ghci library had a "ghci" flag...
* rts: Fix erroneous usage of vsnprintfBen Gamari2020-09-161-1/+1
| | | | | | | As pointed out in #18685, this should be snprintf not vsnprintf. This appears to be due to a cut-and-paste error. Fixes #18658.
* Include -f{write,validate}-ide-info in the User's Guide flag referenceRyan Scott2020-09-162-0/+16
| | | | | | | Previously, these were omitted from the flag reference due to a layout oversight in `docs/users_guide/flags.{rst,py}`. Fixes #18426.
* Introduce and use DerivClauseTys (#18662)Ryan Scott2020-09-1511-46/+141
| | | | | | | | | | | | This switches `deriv_clause_tys` so that instead of using a list of `LHsSigType`s to represent the types in a `deriving` clause, it now uses a sum type. `DctSingle` represents a `deriving` clause with no enclosing parentheses, while `DctMulti` represents a clause with enclosing parentheses. This makes pretty-printing easier and avoids confusion between `HsParTy` and the enclosing parentheses in `deriving` clauses, which are different semantically. Fixes #18662.
* Enhance metrics outputSylvain Henry2020-09-152-10/+11
|
* Export enrichHie from GHC.Iface.Ext.AstZubin Duggal2020-09-151-1/+1
| | | | This is useful for `ghcide`
* Care with implicit-parameter superclassesSimon Peyton Jones2020-09-1516-81/+211
| | | | | | | | | | | | | | | | | | | | | | Two bugs, #18627 and #18649, had the same cause: we were not account for the fact that a constaint tuple might hide an implicit parameter. The solution is not hard: look for implicit parameters in superclasses. See Note [Local implicit parameters] in GHC.Core.Predicate. Then we use this new function in two places * The "short-cut solver" in GHC.Tc.Solver.Interact.shortCutSolver which simply didn't handle implicit parameters properly at all. This fixes #18627 * The specialiser, which should not specialise on implicit parameters This fixes #18649 There are some lingering worries (see Note [Local implicit parameters]) but things are much better.
* Fix rtsopts documentationDenisFrezzato2020-09-151-1/+1
|
* Also cache other hadrian buildsWander Hillen2020-09-141-0/+1
|
* Do the hadrian rebuild multicoreWander Hillen2020-09-141-1/+1
|
* Move ahead cabal cache restoration to before use of cabalWander Hillen2020-09-141-2/+1
|
* Populate gitlab cache after buildingWander Hillen2020-09-141-0/+2
|
* docs: -B rts option sounds the bell on every GC (#18351)Adam Sandberg Eriksson2020-09-141-1/+1
|
* Hackily decouple the parser from the desugarerSebastian Graf2020-09-122-6/+37
| | | | | | | | | | | In a hopefully temporary hack, I re-used the idea from !1957 of using a nullary type family to break the dependency from GHC.Driver.Hooks on the definition of DsM ("Abstract Data"). This in turn broke the last dependency from the parser to the desugarer. More details in `Note [The Decoupling Abstract Data Hack]`. In the future, we hope to undo this hack again in favour of breaking the dependency from the parser to DynFlags altogether.
* Extract definition of DsM into GHC.HsToCore.TypesSebastian Graf2020-09-128-76/+96
| | | | | | | | | | | | | | | | | | `DsM` was previously defined in `GHC.Tc.Types`, along with `TcM`. But `GHC.Tc.Types` is in the set of transitive dependencies of `GHC.Parser`, a set which we aim to minimise. Test case `CountParserDeps` checks for that. Having `DsM` in that set means the parser also depends on the innards of the pattern-match checker in `GHC.HsToCore.PmCheck.Types`, which is the reason we have that module in the first place. In the previous commit, we represented the `TyState` by an `InertSet`, but that pulls the constraint solver as well as 250 more modules into the set of dependencies, triggering failure of `CountParserDeps`. Clearly, we want to evolve the pattern-match checker (and the desugarer) without being concerned by this test, so this patch includes a small refactor that puts `DsM` into its own module.
* Make `tcCheckSatisfiability` incremental (#18645)Sebastian Graf2020-09-128-50/+178
| | | | | | | | | | | | | | | | | By taking and returning an `InertSet`. Every new `TcS` session can then pick up where a prior session left with `setTcSInerts`. Since we don't want to unflatten the Givens (and because it leads to infinite loops, see !3971), we introduced a new variant of `runTcS`, `runTcSInerts`, that takes and returns the `InertSet` and makes sure not to unflatten the Givens after running the `TcS` action. Fixes #18645 and #17836. Metric Decrease: T17977 T18478
* Avoid iterating twice in `zipTyEnv` (#18535)theobat2020-09-122-2/+20
| | | | | | | | | | | | | | | | | | | | | | zipToUFM is a new function to replace `listToUFM (zipEqual ks vs)`. An explicit recursion is preferred due to the sensible nature of fusion. T12227 -6.0% T12545 -12.3% T5030 -9.0% T9872a -1.6% T9872b -1.6% T9872c -2.0% ------------------------- Metric Decrease: T12227 T12545 T5030 T9872a T9872b T9872c -------------------------
* Make sure we can read past perf notesKrzysztof Gogolewski2020-09-121-1/+9
| | | | See #18656.
* Don't quote argument to Hadrian's test-env flag (#18656)Ryan Scott2020-09-121-1/+1
| | | | | | | Doing so causes the name of the test environment to gain an extra set of double quotes, which changes the name entirely. Fixes #18656.
* hadrian: Pass input file to makeindexBen Gamari2020-09-121-1/+1
| | | | | | Strangely I find that on Alpine (and apparently only on Alpine) the latex makeindex command expects to be given a filename, lest it reads from stdin.
* PmCheck: Disattach COMPLETE pragma lookup from TyConsSebastian Graf2020-09-1222-467/+367
| | | | | | | | | | | | | | | | | | | By not attaching COMPLETE pragmas with a particular TyCon and instead assume that every COMPLETE pragma is applicable everywhere, we can drastically simplify the logic that tries to initialise available COMPLETE sets of a variable during the pattern-match checking process, as well as fixing a few bugs. Of course, we have to make sure not to report any of the ill-typed/unrelated COMPLETE sets, which came up in a few regression tests. In doing so, we fix #17207, #18277 and #14422. There was a metric decrease in #18478 by ~20%. Metric Decrease: T18478
* Add testsSandy Maguire2020-09-124-0/+45
|
* Add clamp function to Data.OrdSandy Maguire2020-09-121-0/+16
|
* Enable TICKY_TICKY for debug builds when building with makefiles.David Himmelstrup2020-09-111-2/+2
|
* Fix typos in TICKY_TICKY symbol names.David Himmelstrup2020-09-111-3/+3
|