summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix T15155l not getting -fllvmwip/llvm-waysKrzysztof Gogolewski2022-10-171-1/+1
|
* testsuite: Fix typo when setting llvm_waysMatthew Pickering2022-10-131-2/+1
| | | | | | | Since 2014 llvm_ways has been set to [] so none of the tests which use only_ways(llvm_ways) have worked as expected. Hopefully the tests still pass with this typo fix!
* Clearer error msg for newtype GADTs with defaulted kindFinley McIlwaine2022-10-1318-75/+157
| | | | | | | | | | | When a newtype introduces GADT eq_specs due to a defaulted RuntimeRep, we detect this and print the error message with explicit kinds. This also refactors newtype type checking to use the new diagnostic infra. Fixes #21447
* Update phases.rst Simon Hengel2022-10-131-2/+2
| | | (the name of the original source file is $1, not $2)
* rts/linker: Add support for .fini sectionsBen Gamari2022-10-133-0/+9
|
* rts/linker: Consolidate initializer/finalizer handlingBen Gamari2022-10-137-251/+316
| | | | | | | | | Here we extend our treatment of initializer/finalizer priorities to include ELF and in so doing refactor things to share the implementation with PEi386. As well, I fix a subtle misconception of the ordering behavior for `.ctors`. Fixes #21847.
* Add a perf test for the generics code pattern from #21839.Andreas Klebinger2022-10-136-0/+109
| | | | | | | | | This code showed a strong shift between compile time (got worse) and run time (got a lot better) recently which is perfectly acceptable. However it wasn't clear why the compile time regression was happening initially so I'm adding this test to make it easier to track such changes in the future.
* Unrestricted OverloadedLabels (#11671)Charles Taylor2022-10-125-33/+135
| | | | | Implements GHC proposal: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0170-unrestricted-overloadedlabels.rst
* winio: do not re-translate input when handle is uncookedTamar Christina2022-10-121-22/+32
|
* remove name shadowingCurran McConnell2022-10-121-8/+7
|
* rts: Don't hint inlining of appendToRunQueueBen Gamari2022-10-122-54/+58
| | | | | | | | | These hints have resulted in compile-time warnings due to failed inlinings for quite some time. Moreover, it's quite unlikely that inlining them is all that beneficial given that they are rather sizeable functions. Resolves #22280.
* Mark T7919 as fragileBryan Richter2022-10-121-3/+7
| | | | | | On x86_64-linux, T7919 timed out ~30 times during July 2022. And again ~30 times in September 2022.
* Make Cmm Lint messages use dump styleKrzysztof Gogolewski2022-10-111-1/+2
| | | | | | | | | | | Lint errors indicate an internal error in GHC, so it makes sense to use it instead of the user style. This is consistent with Core Lint and STG Lint: https://gitlab.haskell.org/ghc/ghc/-/blob/22096652/compiler/GHC/Core/Lint.hs#L429 https://gitlab.haskell.org/ghc/ghc/-/blob/22096652/compiler/GHC/Stg/Lint.hs#L144 Fixes #22218.
* Separate IPE source file from spanBen Gamari2022-10-1113-442/+168
| | | | | | The source file name can very often be shared across many IPE entries whereas the source coordinates are generally unique. Separate the two to exploit sharing of the former.
* Refactor IPE initializationBen Gamari2022-10-1129-556/+683
| | | | | | | | | | | | | | | Here we refactor the representation of info table provenance information in object code to significantly reduce its size and link-time impact. Specifically, we deduplicate strings and represent them as 32-bit offsets into a common string table. In addition, we rework the registration logic to eliminate allocation from the registration path, which is run from a static initializer where things like allocation are technically undefined behavior (although it did previously seem to work). For similar reasons we eliminate lock usage from registration path, instead relying on atomic CAS. Closes #22077.
* rts: Refactor IPE tracing supportBen Gamari2022-10-116-66/+34
|
* base: Move IPE helpers to GHC.InfoProvBen Gamari2022-10-116-77/+108
|
* base: Move CString, CStringLen to GHC.ForeignBen Gamari2022-10-112-11/+6
|
* rts: Add missing declaration of stg_noDuplicateBen Gamari2022-10-111-0/+1
|
* ByteArray# is unlifted, not unboxedBodigrim2022-10-111-4/+4
|
* Expand comment for Data.List.permutationsjwaldmann2022-10-111-0/+3
|
* Extend documentation for Data.List, mostly wrt infinite listsBodigrim2022-10-113-53/+216
|
* 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`.
* Clean up `findWiredInUnit`. In particular, avoid `head`.M Farkas-Dyck2022-09-281-12/+10
|
* Avoid Data.List.group; prefer Data.List.NonEmpty.groupBodigrim2022-09-2814-75/+73
| | | | | This allows to avoid further partiality, e. g., map head . group is replaced by map NE.head . NE.group, and there are less panic calls.