summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove old .travis.ymlJohn Ericson2020-12-131-61/+0
|
* mkDocs: support hadrian bindists #18973Adam Sandberg Ericsson2020-12-121-1/+3
|
* hadrian: correctly copy the docs dir into the bindist #18669Adam Sandberg Ericsson2020-12-121-1/+9
|
* Demand: Simplify `CU(U)` to `U` (#19005)Sebastian Graf2020-12-126-35/+47
| | | | | | Both sub-demands encode the same information. This is a trivial change and already affects a few regression tests (e.g. `T5075`), so no separate regression test is necessary.
* DmdAnal: Annotate top-level function bindings with demands (#18894)Sebastian Graf2020-12-1215-155/+937
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's useful to annotate a non-exported top-level function like `g` in ```hs module Lib (h) where g :: Int -> Int -> (Int,Int) g m 1 = (m, 0) g m n = (2 * m, 2 `div` n) {-# NOINLINE g #-} h :: Int -> Int h 1 = 0 h m | odd m = snd (g m 2) | otherwise = uncurry (+) (g 2 m) ``` with its demand `UCU(CS(P(1P(U),SP(U))`, which tells us that whenever `g` was called, the second component of the returned pair was evaluated strictly. Since #18903 we do so for local functions, where we can see all calls. For top-level functions, we can assume that all *exported* functions are demanded according to `topDmd` and thus get sound demands for non-exported top-level functions. The demand on `g` is crucial information for Nested CPR, which may the go on and unbox `g` for the second pair component. That is true even if that pair component may diverge, as is the case for the call site `g 13 0`, which throws a div-by-zero exception. In `T18894b`, you can even see the new demand annotation enabling us to eta-expand a function that we wouldn't be able to eta-expand without Call Arity. We only track bindings of function type in order not to risk huge compile-time regressions, see `isInterestingTopLevelFn`. There was a CoreLint check that rejected strict demand annotations on recursive or top-level bindings, which seems completely unjustified. All the cases I investigated were fine, so I removed it. Fixes #18894.
* Use static array in zeroCountSylvain Henry2020-12-111-37/+6
|
* rts: don't use siginterrupt (#19019)Sylvain Henry2020-12-111-5/+1
|
* ghci: reuse Arch from ghc-bootSylvain Henry2020-12-112-63/+22
|
* ghci: don't compile unneeded modulesSylvain Henry2020-12-111-2/+2
|
* Move SizedSeq into ghc-bootSylvain Henry2020-12-118-9/+8
|
* Parser: move parser utils into their own moduleSylvain Henry2020-12-114-58/+72
| | | | Move code unrelated to runtime evaluation out of GHC.Runtime.Eval
* Hadrian: fix libffi tarball parsingSylvain Henry2020-12-111-1/+1
| | | | | | Fix parsing of "libffi-3.3.tar.gz". NB: switch to a newer libffi isn't done in this patch
* Validate script: fix configure command when using stackSylvain Henry2020-12-111-1/+4
|
* Arrows: correctly query arrow methods (#17423)Sylvain Henry2020-12-114-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Consider the following code: proc (C x y) -> ... Before this patch, the evidence binding for the Arrow dictionary was attached to the C pattern: proc (C x y) { $dArrow = ... } -> ... But then when we desugar this, we use arrow operations ("arr", ">>>"...) specialised for this arrow: let arr_xy = arr $dArrow -- <-- Not in scope! ... in arr_xy (\(C x y) { $dArrow = ... } -> ...) This patch allows arrow operations to be type-checked before the proc itself, avoiding this issue. Fix #17423
* Delete outdated Note [Kind-checking tyvar binders for associated types]Ryan Scott2020-12-112-24/+0
| | | | | | | | | | | This Note has severely bitrotted, as it has no references anywhere in the codebase, and none of the functions that it mentions exist anymore. Let's just delete this. While I was in town, I deleted some outdated comments from `checkFamPatBinders` of a similar caliber. Fixes #19008. [ci skip]
* Add :doc test case for duplicate record fieldsAaron Allen2020-12-113-0/+17
| | | | | Tests that the output of the `:doc` command is correct for duplicate record fields defined using -XDuplicateRecordFields.
* Elide extraneous messages for :doc command (#15784)Aaron Allen2020-12-114-5/+26
| | | | | | | | Do not print `<has no documentation>` alongside a valid doc. Additionally, if two matching symbols lack documentation then the message will only be printed once. Hence, `<has no documentation>` will be printed at most once and only if all matching symbols are lacking docs.
* Display FFI labels (fix #18539)Sylvain Henry2020-12-112-8/+10
|
* gitlab-ci: Fix name of flavour in ThreadSanitizer jobBen Gamari2020-12-111-1/+1
| | | | | It looks like I neglected to update this after introduce flavour transformers.
* gitlab-ci: Fix incorrect Docker image for nightly cross jobBen Gamari2020-12-111-11/+8
| | | | Also refactor the job definition to eliminate the bug by construction.
* users guide: Describe GC lifecycle eventsBen Gamari2020-12-113-5/+101
| | | | | | Every time I am asked about how to interpret these events I need to figure it out from scratch. It's well past time that the users guide properly documents these.
* users guide: Fix syntax errorsBen Gamari2020-12-111-23/+21
| | | | Fixes errors introduced by 3a55b3a2574f913d046f3a6f82db48d7f6df32e3.
* rts/linker/Elf.c: add missing <dlfcn.h> include (musl support)Sergei Trofimovich2020-12-101-0/+3
| | | | | | | | | | | | | | The change fixes build failure on musl: ``` rts/linker/Elf.c:2031:3: error: warning: implicit declaration of function 'dlclose'; did you mean 'close'? [-Wimplicit-function-declaration] 2031 | dlclose(nc->dlopen_handle); | ^~~~~~~ | close ``` Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* doc: Extra-clarify -fomit-yieldsKirill Elagin2020-12-101-1/+1
| | | | Be more clear on what this optimisation being on by default means in terms of yields.
* doc: Clarify the default for -fomit-yieldsKirill Elagin2020-12-101-1/+1
| | | | | | “Yield points enabled” is confusing (and probably wrong? I am not 100% sure what it means). Change it to a simple “on”. Undo this change from 2c23fff2e03e77187dc4d01f325f5f43a0e7cad2.
* Bump time submodule.Andreas Klebinger2020-12-081-0/+0
| | | | This should fix #19002.
* GHC.Cmm.Opt: Be stricter in results.Andreas Klebinger2020-12-081-51/+51
| | | | | | | | | | | | | Optimization either returns Nothing if nothing is to be done or `Just <cmmExpr>` otherwise. There is no point in being lazy in `cmmExpr`. We usually inspect this element so the thunk gets forced not long after. We might eliminate it as dead code once in a blue moon but that's not a case worth optimizing for. Overall the impact of this is rather low. As Cmm.Opt doesn't allocate much (compared to the rest of GHC) to begin with.
* Cmm.Sink: Optimize retaining of assignments, live sets.Andreas Klebinger2020-12-085-52/+174
| | | | | | | | | | | | | | | | | | | | | | | | | Sinking requires us to track live local regs after each cmm statement. We used to do this via "Set LocalReg". However we can replace this with a solution based on IntSet which is overall more efficient without losing much. The thing we lose is width of the variables, which isn't used by the sinking pass anyway. I also reworked how we keep assignments to regs mentioned in skipped assignments. I put the details into Note [Keeping assignemnts mentioned in skipped RHSs]. The gist of it is instead of keeping track of it via the use count which is a `IntMap Int` we now use the live regs set (IntSet) which is quite a bit faster. I think it also matches the semantics a lot better. The skipped (not discarded) assignment does in fact keep the regs on it's rhs alive so keeping track of this in the live set seems like the clearer solution as well. Improves allocations for T3294 by yet another 1%.
* Cmm: Make a few types and utility function slightly stricter.Andreas Klebinger2020-12-082-9/+11
| | | | | | About 0.6% reduction in allocations for the code I was looking at. Not a huge difference but no need to throw away performance.
* CmmSink: Force inlining of foldRegsDefdAndreas Klebinger2020-12-081-6/+45
| | | | | Helps avoid allocating the folding function. Improves perf for T3294 by about 1%.
* CodeGen: Make folds User/DefinerOfRegs INLINEABLE.Andreas Klebinger2020-12-082-0/+7
| | | | | | | | | Reduces allocation for the test case I was looking at by about 1.2%. Mostly from avoiding allocation of some folding functions which turn into let-no-escape bindings which just reuse their environment instead. We also force inlining in a few key places in CmmSink which helps a bit more.
* hadrian: build the _l and _thr_l rts flavours in the develN flavoursAdam Sandberg Ericsson2020-12-081-1/+1
| | | | | The ghc binary requires the eventlog rts since fc644b1a643128041cfec25db84e417851e28bab
* Fix kind inference for data types. Again.Simon Peyton Jones2020-12-0832-331/+735
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes several aspects of kind inference for data type declarations, especially data /instance/ declarations Specifically 1. In kcConDecls/kcConDecl make it clear that the tc_res_kind argument is only used in the H98 case; and in that case there is no result kind signature; and hence no need for the disgusting splitPiTys in kcConDecls (now thankfully gone). The GADT case is a bit different to before, and much nicer. This is what fixes #18891. See Note [kcConDecls: kind-checking data type decls] 2. Do not look at the constructor decls of a data/newtype instance in tcDataFamInstanceHeader. See GHC.Tc.TyCl.Instance Note [Kind inference for data family instances]. This was a new realisation that arose when doing (1) This causes a few knock-on effects in the tests suite, because we require more information than before in the instance /header/. New user-manual material about this in "Kind inference in data type declarations" and "Kind inference for data/newtype instance declarations". 3. Minor improvement in kcTyClDecl, combining GADT and H98 cases 4. Fix #14111 and #8707 by allowing the header of a data instance to affect kind inferece for the the data constructor signatures; as described at length in Note [GADT return types] in GHC.Tc.TyCl This led to a modest refactoring of the arguments (and argument order) of tcConDecl/tcConDecls. 5. Fix #19000 by inverting the sense of the test in new_locs in GHC.Tc.Solver.Canonical.canDecomposableTyConAppOK.
* testsuite: Add a test for #18923Ben Gamari2020-12-052-0/+20
|
* Fix bad span calculations of post qualified importsShayne Fletcher2020-12-054-8/+83
|
* gitlab-ci: Run linters through ci.shBen Gamari2020-12-032-9/+12
| | | | Ensuring that the right toolchain is used.
* gitlab-ci: Fix copy-paste errorBen Gamari2020-12-031-6/+6
| | | | Also be more consistent in quoting.
* rts/linker: Use m32 to allocate symbol extras in PEi386Ben Gamari2020-12-014-33/+20
|
* rts/m32: Introduce NEEDS_M32 macroBen Gamari2020-12-015-27/+32
| | | | Instead of relying on RTS_LINKER_USE_MMAP
* rts/Linker: Introduce Windows implementations for mmapForLinker, et al.Ben Gamari2020-12-011-1/+32
|
* rts/linker: Introduce munmapForLinkerBen Gamari2020-12-017-30/+22
| | | | Consolidates munmap calls to ensure consistent error handling.
* rts: Introduce mmapAnonForLinkerBen Gamari2020-12-018-26/+41
| | | | | | | | Previously most of the uses of mmapForLinker were mapping anonymous memory, resulting in a great deal of unnecessary repetition. Factor this out into a new helper. Also fixes a few places where error checking was missing or suboptimal.
* Rename the flattener to become the rewriter.Richard Eisenberg2020-12-0116-492/+459
| | | | | | | | Now that flattening doesn't produce flattening variables, it's not really flattening anything: it's rewriting. This change also means that the rewriter can no longer be confused the core flattener (in GHC.Core.Unify), which is sometimes used during type-checking.
* Remove flattening variablesRichard Eisenberg2020-12-01119-3752/+3693
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch redesigns the flattener to simplify type family applications directly instead of using flattening meta-variables and skolems. The key new innovation is the CanEqLHS type and the new CEqCan constraint (Ct). A CanEqLHS is either a type variable or exactly-saturated type family application; either can now be rewritten using a CEqCan constraint in the inert set. Because the flattener no longer reduces all type family applications to variables, there was some performance degradation if a lengthy type family application is now flattened over and over (not making progress). To compensate, this patch contains some extra optimizations in the flattener, leading to a number of performance improvements. Close #18875. Close #18910. There are many extra parts of the compiler that had to be affected in writing this patch: * The family-application cache (formerly the flat-cache) sometimes stores coercions built from Given inerts. When these inerts get kicked out, we must kick out from the cache as well. (This was, I believe, true previously, but somehow never caused trouble.) Kicking out from the cache requires adding a filterTM function to TrieMap. * This patch obviates the need to distinguish "blocking" coercion holes from non-blocking ones (which, previously, arose from CFunEqCans). There is thus some simplification around coercion holes. * Extra commentary throughout parts of the code I read through, to preserve the knowledge I gained while working. * A change in the pure unifier around unifying skolems with other types. Unifying a skolem now leads to SurelyApart, not MaybeApart, as documented in Note [Binding when looking up instances] in GHC.Core.InstEnv. * Some more use of MCoercion where appropriate. * Previously, class-instance lookup automatically noticed that e.g. C Int was a "unifier" to a target [W] C (F Bool), because the F Bool was flattened to a variable. Now, a little more care must be taken around checking for unifying instances. * Previously, tcSplitTyConApp_maybe would split (Eq a => a). This is silly, because (=>) is not a tycon in Haskell. Fixed now, but there are some knock-on changes in e.g. TrieMap code and in the canonicaliser. * New function anyFreeVarsOf{Type,Co} to check whether a free variable satisfies a certain predicate. * Type synonyms now remember whether or not they are "forgetful"; a forgetful synonym drops at least one argument. This is useful when flattening; see flattenView. * The pattern-match completeness checker invokes the solver. This invocation might need to look through newtypes when checking representational equality. Thus, the desugarer needs to keep track of the in-scope variables to know what newtype constructors are in scope. I bet this bug was around before but never noticed. * Extra-constraints wildcards are no longer simplified before printing. See Note [Do not simplify ConstraintHoles] in GHC.Tc.Solver. * Whether or not there are Given equalities has become slightly subtler. See the new HasGivenEqs datatype. * Note [Type variable cycles in Givens] in GHC.Tc.Solver.Canonical explains a significant new wrinkle in the new approach. * See Note [What might match later?] in GHC.Tc.Solver.Interact, which explains the fix to #18910. * The inert_count field of InertCans wasn't actually used, so I removed it. Though I (Richard) did the implementation, Simon PJ was very involved in design and review. This updates the Haddock submodule to avoid #18932 by adding a type signature. ------------------------- Metric Decrease: T12227 T5030 T9872a T9872b T9872c Metric Increase: T9872d -------------------------
* Bump the # of commits searched for perf baselineRichard Eisenberg2020-12-011-1/+1
| | | | | | | | The previous value of 75 meant that a feature branch with more than 75 commits would get spurious CI passes. This affects #18692, but does not fix that ticket, because if a baseline cannot be found, we should fail, not succeed.
* Move core flattening algorithm to Core.UnifyRichard Eisenberg2020-12-0117-693/+731
| | | | | | | | | | This sets the stage for a later change, where this algorithm will be needed from GHC.Core.InstEnv. This commit also splits GHC.Core.Map into GHC.Core.Map.Type and GHC.Core.Map.Expr, in order to avoid module import cycles with GHC.Core.
* Include tried paths in findToolDir errorjneira2020-11-301-6/+8
|
* rts/linker: Don't declare dynamic objects with image_mappedGHC GitLab CI2020-11-301-1/+1
| | | | This previously resulted in warnings due to spurious unmap failures.
* rts/linker: Move shared library loading logic into Elf.cBen Gamari2020-11-305-184/+197
|
* rts/linker: Initialise CCSs from native shared objectsBen Gamari2020-11-302-1/+7
|