summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* hadrian/make: Detect makeindexwip/fix-xelatexBen Gamari2020-06-017-9/+21
| | | | | | Previously we would simply assume that makeindex was available. Now we correctly detect it in `configure` and respect this conclusion in hadrian and make.
* make: Respect XELATEX variableBen Gamari2020-05-311-5/+5
| | | | | Previously we simply ignored the XELATEX variable when building PDF documentation.
* Simplify contexts in GHC.Iface.Ext.AstZubin Duggal2020-05-301-315/+238
|
* Windows: Bump Windows toolchain to 0.2Ben Gamari2020-05-301-1/+1
|
* Optimize GHC.Utils.Monad.Andreas Klebinger2020-05-301-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many functions in this module are recursive and as such are marked loop breakers. Which means they are unlikely to get an unfolding. This is *bad*. We always want to specialize them to specific Monads. Which requires a visible unfolding at the use site. I rewrote the recursive ones from: foo f x = ... foo x' ... to foo f x = go x where go x = ... As well as giving some pragmas to make all of them available for specialization. The end result is a reduction of allocations of about -1.4% for nofib/spectral/simple/Main.hs when compiled with `-O`. ------------------------- Metric Decrease: T12425 T14683 T5631 T9233 T9675 T9961 WWRec -------------------------
* PPC NCG: Fix .size directive on powerpc64 ELF v1Peter Trommler2020-05-301-1/+6
| | | | | | Thanks to Sergei Trofimovich for pointing out the issue. Fixes #18237
* rts: Drop compatibility shims for Windows VistaBen Gamari2020-05-304-53/+10
| | | | | We can now assume that the thread and processor group interfaces are available.
* users-guide: Note change in getNumProcessors in users guideBen Gamari2020-05-302-3/+8
|
* rts: Teach getNumProcessors to return available processorsBen Gamari2020-05-302-11/+35
| | | | | | | | | | | | Previously we would report the number of physical processors, which can be quite wrong in a containerized setting. Now we rather return how many processors are in our affinity mask when possible. I also refactored the code to prefer platform-specific since this will report logical CPUs instead of physical (using `machdep.cpu.thread_count` on Darwin and `cpuset_getaffinity` on FreeBSD). Fixes #14781.
* PPC NCG: No per-symbol .section ".toc" directivesPeter Trommler2020-05-291-2/+0
| | | | | | | | | All position independent symbols are collected during code generation and emitted in one go. Prepending each symbol with a .section ".toc" directive is redundant. This patch drops the per-symbol directives leading to smaller assembler files. Fixes #18250
* Build a threaded stage 1 if the bootstrapping GHC supports it.Travis Whitaker2020-05-298-21/+98
|
* hadrian: introduce 'install' targetAlp Mestanogullari2020-05-293-1/+38
| | | | | | | Its logic is very simple. It `need`s the `binary-dist-dir` target and runs suitable `configure` and `make install` commands for the user. A new `--prefix` command line argument is introduced to specify where GHC should be installed.
* Always define USE_PTHREAD_FOR_ITIMER for FreeBSD.Gleb Popov2020-05-291-1/+1
|
* Fix typo in documentationJeremy Schlatter2020-05-291-1/+1
|
* base: Scrap deprecation plan for Data.Monoid.{First,Last}Simon Jakobi2020-05-292-20/+3
| | | | | | See the discussion on the libraries mailing list for context: https://mail.haskell.org/pipermail/libraries/2020-April/030357.html
* Eta expand un-saturated primopsBen Gamari2020-05-298-51/+108
| | | | | | | | | | | Now since we no longer try to predict CAFfyness we have no need for the solution to #16846. Eta expanding unsaturated primop applications is conceptually simpler, especially in the presence of levity polymorphism. This essentially reverts cac8dc9f51e31e4c0a6cd9bc302f7e1bc7c03beb, as suggested in #18079. Closes #18079.
* Allow simplification through runRW#Ben Gamari2020-05-296-40/+231
| | | | | | | | | | | | | | | | | | | | | | | | Because runRW# inlines so late, we were previously able to do very little simplification across it. For instance, given even a simple program like case runRW# (\s -> let n = I# 42# in n) of I# n# -> f n# we previously had no way to avoid the allocation of the I#. This patch allows the simplifier to push strict contexts into the continuation of a runRW# application, as explained in in Note [Simplification of runRW#] in GHC.CoreToStg.Prep. Fixes #15127. Metric Increase: T9961 Metric Decrease: ManyConstructors Co-Authored-By: Simon Peyton-Jone <simonpj@microsoft.com>
* Do not float join points in exprIsConApp_maybeSimon Peyton Jones2020-05-291-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We hvae been making exprIsConApp_maybe cleverer in recent times: commit b78cc64e923716ac0512c299f42d4d0012306c05 Date: Thu Nov 15 17:14:31 2018 +0100 Make constructor wrappers inline only during the final phase commit 7833cf407d1f608bebb1d38bb99d3035d8d735e6 Date: Thu Jan 24 17:58:50 2019 +0100 Look through newtype wrappers (Trac #16254) commit c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1 Date: Thu Feb 21 12:03:22 2019 +0000 Fix exprIsConApp_maybe But alas there was still a bug, now immortalised in Note [Don't float join points] in SimpleOpt. It's quite hard to trigger because it requires a dead join point, but it came up when compiling Cabal Cabal.Distribution.Fields.Lexer.hs, when working on !3113. Happily, the fix is extremly easy. Finding the bug was not so easy.
* Make Lint check return type of a join pointSimon Peyton Jones2020-05-291-7/+31
| | | | | | | | | Consider join x = rhs in body It's important that the type of 'rhs' is the same as the type of 'body', but Lint wasn't checking that invariant. Now it does! This was exposed by investigation into !3113.
* CoreToStg: Add Outputable ArgInfo instanceBen Gamari2020-05-291-1/+7
|
* Fix "build/elem" RULE.Andreas Klebinger2020-05-2911-67/+319
| | | | | | | | | | | | | | | | | | | | | | | | An redundant constraint prevented the rule from matching. Fixing this allows a call to elem on a known list to be translated into a series of equality checks, and eventually a simple case expression. Surprisingly this seems to regress elem for strings. To avoid this we now also allow foldrCString to inline and add an UTF8 variant. This results in elem being compiled to a tight non-allocating loop over the primitive string literal which performs a linear search. In the process this commit adds UTF8 variants for some of the functions in GHC.CString. This is required to make this work for both ASCII and UTF8 strings. There are also small tweaks to the CString related rules. We now allow ourselfes the luxury to compare the folding function via eqExpr, which helps to ensure the rule fires before we inline foldrCString*. Together with a few changes to allow matching on both the UTF8 and ASCII variants of the CString functions.
* Rip out CmmStackInfo(updfr_space)Ben Gamari2020-05-285-14/+6
| | | | | As noted in #18232, this field is currently completely unused and moreover doesn't have a clear meaning.
* hadrian: Don't track GHC's verbosity argumentBen Gamari2020-05-281-2/+4
| | | | | Teach hadrian to ignore GHC's -v argument in its recompilation check, thus fixing #18131.
* Ticky-ticky: Record DataCon name in ticker nameBen Gamari2020-05-282-4/+7
| | | | | This makes it significantly easier to spot the nature of allocations regressions and comes at a reasonably low cost.
* DmdAnal: Recognise precise exceptions from case alternatives (#18086)Sebastian Graf2020-05-284-8/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider ```hs m :: IO () m = do putStrLn "foo" error "bar" ``` `m` (from #18086) always throws a (precise or imprecise) exception or diverges. Yet demand analysis infers `<L,A>` as demand signature instead of `<L,A>x` for it. That's because the demand analyser sees `putStrLn` occuring in a case scrutinee and decides that it has to `deferAfterPreciseException`, because `putStrLn` throws a precise exception on some control flow paths. This will mask the `botDiv` `Divergence`of the single case alt containing `error` to `topDiv`. Since `putStrLn` has `topDiv` itself, the final `Divergence` is `topDiv`. This is easily fixed: `deferAfterPreciseException` works by `lub`ing with the demand type of a virtual case branch denoting the precise exceptional control flow. We used `nopDmdType` before, but we can be more precise and use `exnDmdType`, which is `nopDmdType` with `exnDiv`. Now the `Divergence` from the case alt will degrade `botDiv` to `exnDiv` instead of `topDiv`, which combines with the result from the scrutinee to `exnDiv`, and all is well. Fixes #18086.
* FloatOut: Only eta-expand dead-end RHS if arity will increase (#18231)Sebastian Graf2020-05-285-3/+59
| | | | | | | | Otherwise we risk turning trivial RHS into non-trivial RHS, introducing unnecessary bindings in the next Simplifier run, resulting in more churn. Fixes #18231.
* Fix #18071Xavier Denis2020-05-285-26/+95
| | | | | | | | Run the core linter on candidate instances to ensure they are well-kinded. Better handle quantified constraints by using a CtWanted to avoid having unsolved constraints thrown away at the end by the solver.
* Add Semigroup/Monoid for Q (#18123)Vladislav Zavialov2020-05-284-0/+25
|
* Avoid unnecessary allocations due to tracing utilitiesBen Gamari2020-05-287-22/+80
| | | | | | | | | | | | | | | | | | | | While ticky-profiling the typechecker I noticed that hundreds of millions of SDocs are being allocated just in case -ddump-*-trace is enabled. This is awful. We avoid this by ensuring that the dump flag check is inlined into the call site, ensuring that the tracing document needn't be allocated unless it's actually needed. See Note [INLINE conditional tracing utilities] for details. Fixes #18168. Metric Decrease: T9961 haddock.Cabal haddock.base haddock.compiler
* GHC.Core.Unfold: Refactor traceInlineBen Gamari2020-05-281-9/+10
| | | | | This reduces duplication as well as fixes a bug wherein -dinlining-check would override -ddump-inlinings. Moreover, the new variant
* Make `identifier` parse unparenthesized `->` (#18060)Joshua Price2020-05-274-0/+17
|
* eventlog: Fix racy flushingBen Gamari2020-05-273-1/+30
| | | | | | | | | | | Previously no attempt was made to avoid multiple threads writing their capability-local eventlog buffers to the eventlog writer simultaneously. This could result in multiple eventlog streams being interleaved. Fix this by documenting that the EventLogWriter's write() and flush() functions may be called reentrantly and fix the default writer to protect its FILE* by a mutex. Fixes #18210.
* core-spec: Modify file paths according to new module hierarchyTakenobu Tani2020-05-275-68/+68
| | | | | | | | | | | | | | | | | | | | | | | This patch updates file paths according to new module hierarchy [1]: * GHC/Core.hs <= coreSyn/CoreSyn.hs * GHC/Core/Coercion.hs <= types/Coercion.hs * GHC/Core/Coercion/Axiom.hs <= types/CoAxiom.hs * GHC/Core/Coercion/Opt.hs <= types/OptCoercion.hs * GHC/Core/DataCon.hs <= basicTypes/DataCon.hs * GHC/Core/FamInstEnv.hs <= types/FamInstEnv.hs * GHC/Core/Lint.hs <= coreSyn/CoreLint.hs * GHC/Core/Subst.hs <= coreSyn/CoreSubst.hs * GHC/Core/TyCo/Rep.hs <= types/TyCoRep.hs * GHC/Core/TyCon.hs <= types/TyCon.hs * GHC/Core/Type.hs <= types/Type.hs * GHC/Core/Unify.hs <= types/Unify.hs * GHC/Types/Literal.hs <= basicTypes/Literal.hs * GHC/Types/Var.hs <= basicTypes/Var.hs [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular [skip ci]
* Enhance Note [About units] for BackpackSylvain Henry2020-05-261-234/+331
|
* Make WorkWrap.Lib.isWorkerSmallEnough aware of the old aritySebastian Graf2020-05-267-11/+108
| | | | | | | | | | We should allow a wrapper with up to 82 parameters when the original function had 82 parameters to begin with. I verified that this made no difference on NoFib, but then again it doesn't use huge records... Fixes #18122.
* Add info about typeclass evidence to .hie filesZubin Duggal2020-05-2611-230/+872
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See `testsuite/tests/hiefile/should_run/HieQueries.hs` and `testsuite/tests/hiefile/should_run/HieQueries.stdout` for an example of this We add two new fields, `EvidenceVarBind` and `EvidenceVarUse` to the `ContextInfo` associated with an Identifier. These are associated with the appropriate identifiers for the evidence variables collected when we come across `HsWrappers`, `TcEvBinds` and `IPBinds` while traversing the AST. Instance dictionary and superclass selector dictionaries from `tcg_insts` and classes defined in `tcg_tcs` are also recorded in the AST as originating from their definition span This allows us to save a complete picture of the evidence constructed by the constraint solver, and will let us report this to the user, enabling features like going to the instance definition from the invocation of a class method(or any other method taking a constraint) and finding all usages of a particular instance. Additionally, - Mark NodeInfo with an origin so we can differentiate between bindings origininating in the source vs those in ghc - Along with typeclass evidence info, also include information on Implicit Parameters - Add a few utility functions to HieUtils in order to query the new info Updates haddock submodule
* Coverage: Factor out addMixEntryBen Gamari2020-05-251-26/+20
|
* Coverage: Don't produce ModBreaks if not HscInterpretedBen Gamari2020-05-251-6/+10
| | | | | emptyModBreaks contains a bottom and consequently it's important that we don't use it unless necessary.
* Coverage: Make ccIndices strictBen Gamari2020-05-251-1/+1
| | | | This just seems like a good idea.
* Coverage: Make tickBoxCount strictBen Gamari2020-05-251-1/+1
| | | | This could otherwise easily cause a leak of (+) thunks.
* Coverage: Drop redundant ad-hoc boot module checkBen Gamari2020-05-251-2/+1
| | | | | | | | To determine whether the module is a boot module Coverage.addTicksToBinds was checking for a `boot` suffix in the module source filename. This is quite ad-hoc and shouldn't be necessary; the callsite in `deSugar` already checks that the module isn't a boot module.
* Revert "Specify kind variables for inferred kinds in base."Ben Gamari2020-05-2521-240/+140
| | | | | | | | As noted in !3132, this has rather severe knock-on consequences in user-code. We'll need to revisit this before merging something along these lines. This reverts commit 9749fe1223d182b1f8e7e4f7378df661c509f396.
* Make Unicode brackets opening/closing tokens (#18225)Joshua Price2020-05-245-4/+35
| | | | | | | The tokens `[|`, `|]`, `(|`, and `|)` are opening/closing tokens as described in GHC Proposal #229. This commit makes the unicode variants (`⟦`, `⟧`, `⦇`, and `⦈`) act the same as their ASCII counterparts.
* Hadrian: fix hp2ps error during cross-compilationSylvain Henry2020-05-241-0/+1
| | | | Fixed by @alp (see https://gitlab.haskell.org/ghc/ghc/issues/16051#note_274265)
* Hadrian: fix distDir per stageSylvain Henry2020-05-241-2/+5
|
* Hadrian: fix cross-compiler build (#16051)Sylvain Henry2020-05-241-14/+33
|
* Remove unused hs-boot fileMatthew Pickering2020-05-242-8/+1
|
* Add orderingTyCon to wiredInTyCons (#18185)Ryan Scott2020-05-244-6/+38
| | | | | | | | | | `Ordering` needs to be wired in for use in the built-in `CmpNat` and `CmpSymbol` type families, but somehow it was never added to the list of `wiredInTyCons`, leading to the various oddities observed in #18185. Easily fixed by moving `orderingTyCon` from `basicKnownKeyNames` to `wiredInTyCons`. Fixes #18185.
* Bump haddock submoduleSylvain Henry2020-05-241-0/+0
|
* Rename GHC.Hs.Types into GHC.Hs.TypeSylvain Henry2020-05-2429-42/+42
| | | | See discussion in https://gitlab.haskell.org/ghc/ghc/issues/13009#note_268610