summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gitlab-ci: Disable use of ld.lld on ARMv7wip/T18280Ben Gamari2020-06-011-1/+3
| | | | | | | | | It turns out that lld non-deterministically fails on ARMv7. I suspect this may be due to the a kernel regression as this only started happening when we upgraded to 5.4. Nevertheless, easily avoided by simply sticking with gold. Works around #18280.
* Improve parser error messages for TemplateHaskellQuotesVladislav Zavialov2020-06-014-4/+18
| | | | | | | | While [e| |], [t| |], [d| |], and so on, steal syntax from list comprehensions, [| |] and [|| ||] do not steal any syntax. Thus we can improve error messages by always accepting them in the lexer. Turns out the renamer already performs necessary validation.
* Improve parser error messages for TypeApplicationsVladislav Zavialov2020-06-0111-25/+48
| | | | | | | | | | | | | | With this patch, we always parse f @t as a type application, thereby producing better error messages. This steals two syntactic forms: * Prefix form of the @-operator in expressions. Since the @-operator is a divergence from the Haskell Report anyway, this is not a major loss. * Prefix form of @-patterns. Since we are stealing loose infix form anyway, might as well sacrifice the prefix form for the sake of much better error messages.
* Improve parser error messages for the @-operatorVladislav Zavialov2020-06-018-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since GHC diverges from the Haskell Report by allowing the user to define (@) as an infix operator, we better give a good error message when the user does so unintentionally. In general, this is rather hard to do, as some failures will be discovered only in the renamer or the type checker: x :: (Integer, Integer) x @ (a, b) = (1, 2) This patch does *not* address this general case. However, it gives much better error messages when the binding is not syntactically valid: pairs xs @ (_:xs') = zip xs xs' Before this patch, the error message was rather puzzling: <interactive>:1:1: error: Parse error in pattern: pairs After this patch, the error message includes a hint: <interactive>:1:1: error: Parse error in pattern: pairs In a function binding for the ‘@’ operator. Perhaps you meant an as-pattern, which must not be surrounded by whitespace
* Hadrian: fix binary-dist target for cross-compilationSylvain Henry2020-06-011-5/+8
|
* Rename the singleton tuple GHC.Tuple.Unit to GHC.Tuple.SoloTom Ellis2020-06-0122-87/+89
|
* Modify file paths to module paths for new module hierarchyTakenobu Tani2020-06-0120-24/+24
| | | | | | | | | | | | | | | | | | | This updates comments only. This patch replaces module references according to new module hierarchy [1][2]. For files under the `compiler/` directory, I replace them as module paths instead of file paths. For instance, `GHC.Unit.State` instead of `compiler/GHC/Unit/State.hs` [3]. For current and future haddock's markup, this patch encloses the module name with "" [4]. [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular [2]: https://gitlab.haskell.org/ghc/ghc/issues/13009 [3]: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3375#note_276613 [4]: https://haskell-haddock.readthedocs.io/en/latest/markup.html#linking-to-modules
* Clean up file paths for new module hierarchyTakenobu Tani2020-06-0140-51/+51
| | | | | | | | | This updates comments only. This patch replaces file references according to new module hierarchy. See also: * https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular * https://gitlab.haskell.org/ghc/ghc/issues/13009
* testsuite: Work around spurious mypy failureBen Gamari2020-06-011-1/+1
|
* testsuite/testutil: Fix bytes/str mismatchBen Gamari2020-06-011-1/+1
|
* testsuite/perf_notes: Fix ill-typed assignmentsBen Gamari2020-06-011-4/+5
|
* testsuite: Refactor ghostscript detectionBen Gamari2020-06-013-25/+45
| | | | Tamar reported that he saw crashes due to unhandled exceptions.
* testsuite: Don't fail if we can't unlink __symlink_testBen Gamari2020-06-011-1/+4
| | | | | Afterall, it's possible we were unable to create it due to lack of symlink permission.
* configure: Modify aclocal.m4 according to new module hierarchyTakenobu Tani2020-06-011-2/+2
| | | | | | | | | | | | | This patch updates file paths according to new module hierarchy [1]: * Rename: * compiler/GHC/Parser.hs <= compiler/parser/Parser.hs * compiler/GHC/Parser/Lexer.hs <= compiler/Parser/Lexer.hs * Add: * compiler/GHC/Cmm/Lexer.hs [1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular
* Fix wording in documentationJeremy Schlatter2020-06-011-1/+0
| | | | | The duplicate "orphan instance" phrase here doesn't make sense, and was probably an accident.
* Lint rhs of IfaceRulefendor2020-06-011-2/+21
|
* Add `isInScope` check to `lintCoercion`fendor2020-06-011-1/+6
| | | | Mirrors the behaviour of `lintType`.
* Apply suggestion to libraries/base/GHC/Exts.hsBodigrim2020-06-011-1/+1
|
* Clarify description of fromListNBodigrim2020-06-011-5/+6
|
* nonmoving: Optimise log2_ceilBen Gamari2020-06-011-7/+1
|
* Winferred-safe-imports: Do not exit with errorKirill Elagin2020-06-011-1/+1
| | | | | | | | Currently, when -Winferred-safe-imports is enabled, even when it is not turned into an error, the compiler will still exit with exit code 1 if this warning was emitted. Make sure it is really treated as a warning.
* HsToCore: Eta expand left sectionsBen Gamari2020-06-012-26/+65
| | | | | | | | Strangely, the comment next to this code already alluded to the fact that even simply eta-expanding will sacrifice laziness. It's quite unclear how we regressed so far. See #18151.
* testsuite: Add test for desugaring of PostfixOperatorsBen Gamari2020-06-013-0/+8
|
* testsuite: Add test for #18151Ben Gamari2020-06-013-0/+12
|
* Always zero shrunk mutable array slop when profilingDaniel Gröber2020-06-011-5/+26
| | | | | | | | | When shrinking arrays in the profiling way we currently don't always zero the leftover slop. This means we can't traverse such closures in the heap profiler. The old Note [zeroing slop] and #8402 have some rationale for why this is so but I belive the reasoning doesn't apply to mutable closures. There users already have to ensure multiple threads don't step on each other's toes so zeroing should be safe.
* Fix OVERWRITING_CLOSURE assuming closures are not inherently usedDaniel Gröber2020-06-011-21/+17
| | | | | | The new ASSERT in LDV_recordDead() was being tripped up by MVars when removeFromMVarBlockedQueue() calls OVERWRITING_CLOSURE() via OVERWRITE_INFO().
* Cleanup OVERWRITING_CLOSURE logicDaniel Gröber2020-06-015-43/+62
| | | | | | | | | | | The code is just more confusing than it needs to be. We don't need to mix the threaded check with the ldv profiling check since ldv's init already checks for this. Hence they can be two separate checks. Taking the sanity checking into account is also cleaner via DebugFlags.sanity. No need for checking the DEBUG define. The ZERO_SLOP_FOR_LDV_PROF and ZERO_SLOP_FOR_SANITY_CHECK definitions the old code had also make things a lot more opaque IMO so I removed those.
* 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.