summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix T16916wip/ghc-io-uringBen Gamari2022-10-161-1/+1
|
* WhitespaceBen Gamari2022-10-161-1/+1
|
* Feature testBen Gamari2022-10-141-1/+5
|
* iouring: Fix completionBen Gamari2022-10-141-25/+34
|
* iouring feature checkBen Gamari2022-10-141-1/+17
|
* Clean up importsBen Gamari2022-10-141-16/+2
|
* URing: Label completion threadsBen Gamari2022-10-141-1/+4
|
* base: Fix #21651Ben Gamari2022-10-142-3/+13
|
* base: Initial commit of RWLockBen Gamari2022-10-142-0/+71
|
* base: Move TVar things to GHC.Conc.TVarBen Gamari2022-10-144-225/+249
|
* Port URing to use PerCapabilityBen Gamari2022-10-141-10/+24
|
* Handle full SQ/SQEBen Gamari2022-10-141-24/+46
|
* Consolidate feature testBen Gamari2022-10-143-8/+10
|
* Hack it togetherBen Gamari2022-10-144-7/+12
|
* hiBen Gamari2022-10-141-11/+23
|
* uring fixesBen Gamari2022-10-142-7/+7
|
* uring: read and write supportBen Gamari2022-10-146-10/+127
|
* Drop blocking support in submitBen Gamari2022-10-141-7/+6
|
* Clean up superfluous CPP guardsBen Gamari2022-10-144-32/+0
|
* Remove unneeded (?) int narrowing bitsWander Hillen2022-10-141-2/+2
|
* Implement I/O event manager based on io_uringBen Gamari2022-10-1417-1/+1389
| | | | | | | | | | | | | This adds an I/O event manager backend based on the io_uring interface available in modern Linux kernels. The relevant code is in /libraries/base/GHC/Event/IoUring.hsc. It also contains the following changes to support the new backend: * Port over the io_uring bindings from @bgamari into base. * Add a new HAVE_IO_URING check similar to HAVE_EPOLL, HAVE_KQUEUE etc. All changes are no-opped if this flag is not set. See also: #18390
* Port MIO to use PerCapabilityBen Gamari2022-10-1410-195/+92
|
* Add GHC.PerCapabilityBen Gamari2022-10-148-0/+125
|
* GHC.IOArray: Introduce unsafeFreezeIOArrayBen Gamari2022-10-141-1/+6
|
* CLabel: fix isInfoTableLabelCheng Shao2022-10-113-2/+9
| | | | isInfoTableLabel does not take Cmm info table into account. This patch is required for data section layout of wasm32 NCG to work.
* Don't include BufPos in interface filesMatthew Pickering2022-10-113-19/+11
| | | | | | | | | | | | Ticket #22162 pointed out that the build directory was leaking into the ABI hash of a module because the BufPos depended on the location of the build tree. BufPos is only used in GHC.Parser.PostProcess.Haddock, and the information doesn't need to be propagated outside the context of a module. Fixes #22162
* CmmToC: emit explicit tail calls when the C compiler supports itCheng Shao2022-10-113-2/+23
| | | | | | | | | | | | | | | Clang 13+ supports annotating a return statement using the musttail attribute, which guarantees that it lowers to a tail call if compilation succeeds. This patch takes advantage of that feature for the unregisterised code generator. The configure script tests availability of the musttail attribute, if it's available, the Cmm tail calls will become C tail calls that avoids the mini interpreter trampoline overhead. Nothing is affected if the musttail attribute is not supported. Clang documentation: https://clang.llvm.org/docs/AttributeReference.html#musttail
* Make SpecConstr bale out less oftenSimon Peyton Jones2022-10-111-67/+85
| | | | | | | | | | | | | | | | | | | | | | When doing performance debugging on #22084 / !8901, I found that the algorithm in SpecConstr.decreaseSpecCount was so aggressive that if there were /more/ specialisations available for an outer function, that could more or less kill off specialisation for an /inner/ function. (An example was in nofib/spectral/fibheaps.) This patch makes it a bit more aggressive, by dividing by 2, rather than by the number of outer specialisations. This makes the program bigger, temporarily: T19695(normal) ghc/alloc +11.3% BAD because we get more specialisation. But lots of other programs compile a bit faster and the geometric mean in perf/compiler is 0.0%. Metric Increase: T19695
* Don't keep exit join points so muchSimon Peyton Jones2022-10-1111-98/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were religiously keeping exit join points throughout, which had some bad effects (#21148, #22084). This MR does two things: * Arranges that exit join points are inhibited from inlining only in /one/ Simplifier pass (right after Exitification). See Note [Be selective about not-inlining exit join points] in GHC.Core.Opt.Exitify It's not a big deal, but it shaves 0.1% off compile times. * Inline used-once non-recursive join points very aggressively Given join j x = rhs in joinrec k y = ....j x.... where this is the only occurrence of `j`, we want to inline `j`. (Unless sm_keep_exits is on.) See Note [Inline used-once non-recursive join points] in GHC.Core.Opt.Simplify.Utils This is just a tidy-up really. It doesn't change allocation, but getting rid of a binding is always good. Very effect on nofib -- some up and down.
* Teach -fno-code about -fprefer-byte-codeMatthew Pickering2022-10-1115-40/+119
| | | | | | | | | | | | | | | | | This patch teachs the code generation logic of -fno-code about -fprefer-byte-code, so that if we need to generate code for a module which prefers byte code, then we generate byte code rather than object code. We keep track separately which modules need object code and which byte code and then enable the relevant code generation for each. Typically the option will be enabled globally so one of these sets should be empty and we will just turn on byte code or object code generation. We also fix the bug where we would generate code for a module which enables Template Haskell despite the fact it was unecessary. Fixes #22016
* Interface Files with Core DefinitionsMatthew Pickering2022-10-1158-144/+989
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds three new flags * -fwrite-if-simplified-core: Writes the whole core program into an interface file * -fbyte-code-and-object-code: Generate both byte code and object code when compiling a file * -fprefer-byte-code: Prefer to use byte-code if it's available when running TH splices. The goal for including the core bindings in an interface file is to be able to restart the compiler pipeline at the point just after simplification and before code generation. Once compilation is restarted then code can be created for the byte code backend. This can significantly speed up start-times for projects in GHCi. HLS already implements its own version of these extended interface files for this reason. Preferring to use byte-code means that we can avoid some potentially expensive code generation steps (see #21700) * Producing object code is much slower than producing bytecode, and normally you need to compile with `-dynamic-too` to produce code in the static and dynamic way, the dynamic way just for Template Haskell execution when using a dynamically linked compiler. * Linking many large object files, which happens once per splice, can be quite expensive compared to linking bytecode. And you can get GHC to compile the necessary byte code so `-fprefer-byte-code` has access to it by using `-fbyte-code-and-object-code`. Fixes #21067
* Tidy implicit bindsMatthew Pickering2022-10-115-18/+10
| | | | | We want to put implicit binds into fat interface files, so the easiest thing to do seems to be to treat them uniformly with other binders.
* Utils.JSON: do not escapeJsonString in ToJson String instanceJoachim Breitner2022-10-101-1/+2
| | | | | as `escapeJsonString` is used in `renderJSON`, so the `JSString` constructor is meant to carry the unescaped string.
* Make rewrite rules "win" over inliningwip/T21851-rule-winSimon Peyton Jones2022-10-1012-161/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a rewrite rule and a rewrite rule compete in the simplifier, this patch makes sure that the rewrite rule "win". That is, in general a bit fragile, but it's a huge help when making specialisation work reliably, as #21851 and #22097 showed. The change is fairly straightforwad, and documented in Note [Rewrite rules and inlining] in GHC.Core.Opt.Simplify.Iteration. Compile-times change, up and down a bit -- in some cases because we get better specialisation. But the payoff (more reliable specialisation) is large. Metrics: compile_time/bytes allocated ----------------------------------------------- T10421(normal) +3.7% BAD T10421a(normal) +5.5% T13253(normal) +1.3% T14052(ghci) +1.8% T15304(normal) -1.4% T16577(normal) +3.1% BAD T17516(normal) +2.3% T17836(normal) -1.9% T18223(normal) -1.8% T8095(normal) -1.3% T9961(normal) +2.5% BAD geo. mean +0.0% minimum -1.9% maximum +5.5% Nofib results are (bytes allocated) +-------------------------------++----------+ | ||tsv (rel) | +===============================++==========+ | imaginary/paraffins || +0.27% | | imaginary/rfib || -0.04% | | real/anna || +0.02% | | real/fem || -0.04% | | real/fluid || +1.68% | | real/gamteb || -0.34% | | real/gg || +1.54% | | real/hidden || -0.01% | | real/hpg || -0.03% | | real/infer || -0.03% | | real/prolog || +0.02% | | real/veritas || -0.47% | | shootout/fannkuch-redux || -0.03% | | shootout/k-nucleotide || -0.02% | | shootout/n-body || -0.06% | | shootout/spectral-norm || -0.01% | | spectral/cryptarithm2 || +1.25% | | spectral/fibheaps || +18.33% | | spectral/last-piece || -0.34% | +===============================++==========+ | geom mean || +0.17% | There are extensive notes in !8897 about the regressions. Briefly * fibheaps: there was a very delicately balanced inlining that tipped over the wrong way after this change. * cryptarithm2 and paraffins are caused by #22274, which is a separate issue really. (I.e. the right fix is *not* to make inlining "win" over rules.) So I'm accepting these changes Metric Increase: T10421 T16577 T9961
* Parser/PostProcess: rename failOp* functionsVladislav Zavialov2022-10-101-8/+8
| | | | | | | | | | There are three functions named failOp* in the parser: failOpNotEnabledImportQualifiedPost failOpImportQualifiedTwice failOpFewArgs Only the last one has anything to do with operators. The other two were named this way either by mistake or due to a misunderstanding of what "op" stands for. This small patch corrects this.
* Add a newline before since pragma in Data.Array.ByteBodigrim2022-10-101-0/+1
|
* Remove mention of make from README.mdsheaf2022-10-071-4/+7
|
* Export symbolSing, SSymbol, and friends (CLC#85)wip/clc-85Ryan Scott2022-10-0614-120/+500
| | | | | | | | | | | | | | | This implements this Core Libraries Proposal: https://github.com/haskell/core-libraries-committee/issues/85 In particular, it: 1. Exposes the `symbolSing` method of `KnownSymbol`, 2. Exports the abstract `SSymbol` type used in `symbolSing`, and 3. Defines an API for interacting with `SSymbol`. This also makes corresponding changes for `natSing`/`KnownNat`/`SNat` and `charSing`/`KnownChar`/`SChar`. This fixes #15183 and addresses part (2) of #21568.
* rts: don't enforce aligned((8)) on 32-bit targetsCheng Shao2022-10-051-2/+2
| | | | | We simply need to align to the word size for pointer tagging to work. On 32-bit targets, aligned((8)) is wasteful.
* Minor fixes following Unicode 15.0.0 updatePierre Le Marre2022-10-053-8/+6
| | | | | - Fix changelog for Unicode 15.0.0 - Fix the checksums of the downloaded Unicode files, in base's tool: "ucd2haskell".
* Use sameByteArray# in sameByteArrayOleg Grenrus2022-10-041-2/+1
|
* Fix docs for pattern synonymsBrandon Chinn2022-10-041-2/+2
|
* chore: extend `.editorconfig` for C filesNicolas Trangez2022-10-041-0/+4
|
* Enforce internal invariant of OrdList and fix bugs in viewCons / viewSnocBodigrim2022-10-011-13/+23
| | | | | `viewCons` used to ignore `Many` constructor completely, returning `VNothing`. `viewSnoc` violated internal invariant of `Many` being a non-empty list.
* Fix a bug in continuation capture across multiple stack chunksAlexis King2022-10-013-2/+37
|
* Scrub various partiality involving empty lists.M Farkas-Dyck2022-09-3015-64/+64
| | | | Avoids some uses of `head` and `tail`, and some panics when an argument is null.
* Boxity: Don't update Boxity unless worker/wrapper follows (#21754)wip/T21754Sebastian Graf2022-09-309-17/+133
| | | | | | | | A small refactoring in our Core Opt pipeline and some new functions for transfering argument boxities from one signature to another to facilitate `Note [Don't change boxity without worker/wrapper]`. Fixes #21754.
* Revert "ci: enable parallel compression for xz"Bryan Richter2022-09-291-1/+1
| | | | | | Combined wxth XZ_OPT=9, this blew the memory capacity of CI runners. This reverts commit a5f9c35f5831ef5108e87813a96eac62803852ab.
* Demand: Format Call SubDemands `Cn(sd)` as `C(n,sd)` (#22231)wip/T22231Sebastian Graf2022-09-2947-174/+182
| | | | | | | | Justification in #22231. Short form: In a demand like `1C1(C1(L))` it was too easy to confuse which `1` belongs to which `C`. Now that should be more obvious. Fixes #22231
* Eliminate headFS, use unconsFS insteadBodigrim2022-09-283-20/+14
| | | | | A small step towards #22185 to avoid partial functions + safe implementation of `startsWithUnderscore`.