summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use better names for updated FastMutInt functions and provide documentation ↵wip/perf-fastint2Josh Meredith2023-01-317-75/+101
| | | | strings.
* Perf: use packed FastMutInts in BinarySylvain Henry2023-01-311-35/+44
|
* Add support for 2 packed FastMutIntsSylvain Henry2023-01-311-22/+70
|
* User's guide: Clarify overlapping instance candidate eliminationJason Shipman2023-01-301-2/+2
| | | | | | | | | | | | This commit updates the user's guide section on overlapping instance candidate elimination to use "or" verbiage instead of "either/or" in regards to the current pair of candidates' being overlappable or overlapping. "Either IX is overlappable, or IY is overlapping" can cause confusion as it suggests "Either IX is overlappable, or IY is overlapping, but not both". This was initially discussed on this Discourse topic: https://discourse.haskell.org/t/clarification-on-overlapping-instance-candidate-elimination/5677
* gen_ci: Only consider release jobs for job metadataMatthew Pickering2023-01-302-4/+3
| | | | | In particular we do not have a release job for FreeBSD so the generation of the platform mapping was failing.
* rel_eng: Fix the name of the ubuntu-* jobsMatthew Pickering2023-01-301-2/+2
| | | | | | These were not uploaded for alpha1 Fixes #22844
* rel_eng: Add check to make sure that release jobs are downloaded by fetch-gitlabMatthew Pickering2023-01-301-0/+10
| | | | | | This check makes sure that if a job is a prefixed by "release-" then the script downloads it and understands how to map the job name to the platform.
* ci: Remove FreeBSD job from release pipelinesMatthew Pickering2023-01-302-63/+1
| | | | We no longer attempt to build or distribute this release
* Take account of loop breakers in specLookupRuleSimon Peyton Jones2023-01-3011-49/+90
| | | | | | | | | | | | | | | | | | | | The key change is that in GHC.Core.Opt.Specialise.specLookupRule we were using realIdUnfolding, which ignores the loop-breaker flag. When given a loop breaker, rule matching therefore looped infinitely -- #22802. In fixing this I refactored a bit. * Define GHC.Core.InScopeEnv as a data type, and use it. (Previously it was a pair: hard to grep for.) * Put several functions returning an IdUnfoldingFun into GHC.Types.Id, namely idUnfolding alwaysActiveUnfoldingFun, whenActiveUnfoldingFun, noUnfoldingFun and use them. (The are all loop-breaker aware.)
* Fix two bugs in TypeData TH reificationRyan Scott2023-01-306-6/+58
| | | | | | | | | | | This patch fixes two issues in the way that `type data` declarations were reified with Template Haskell: * `type data` data constructors are now properly reified using `DataConI`. This is accomplished with a special case in `reifyTyCon`. Fixes #22818. * `type data` type constructors are now reified in `reifyTyCon` using `TypeDataD` instead of `DataD`. Fixes #22819.
* Handle `type data` properly in tyThingParent_maybeRyan Scott2023-01-306-8/+42
| | | | | | | | | | | | Unlike most other data constructors, data constructors declared with `type data` are represented in `TyThing`s as `ATyCon` rather than `ADataCon`. The `ATyCon` case in `tyThingParent_maybe` previously did not consider the possibility of the underlying `TyCon` being a promoted data constructor, which led to the oddities observed in #22817. This patch adds a dedicated special case in `tyThingParent_maybe`'s `ATyCon` case for `type data` data constructors to fix these oddities. Fixes #22817.
* ghc-the-library: Retain cafs in both static in dynamic builds.Andreas Klebinger2023-01-303-4/+42
| | | | | | | | | | | | | | | | | | | | | We use keepCAFsForGHCi.c to force -fkeep-cafs behaviour by using a __attribute__((constructor)) function. This broke for static builds where the linker discarded the object file since it was not reverenced from any exported code. We fix this by asserting that the flag is enabled using a function in the same module as the constructor. Which causes the object file to be retained by the linker, which in turn causes the constructor the be run in static builds. This changes nothing for dynamic builds using the ghc library. But causes static to also retain CAFs (as we expect them to). Fixes #22417. ------------------------- Metric Decrease: T21839r -------------------------
* compiler: fix data section alignment in the wasm NCGCheng Shao2023-01-301-10/+10
| | | | | | | | | | | | | Previously we tried to lower the alignment requirement as far as possible, based on the section kind inferred from the CLabel. For info tables, .p2align 1 was applied given the GC should only need the lowest bit to tag forwarding pointers. But this would lead to unaligned loads/stores, which has a performance penalty even if the wasm spec permits it. Furthermore, the test suite has shown memory corruption in a few cases when compacting gc is used. This patch takes a more conservative approach: all data sections except C strings align to word size.
* nativeGen: Disable asm-shortcutting on DarwinBen Gamari2023-01-302-2/+19
| | | | | | | | | | | | | Asm-shortcutting may produce relative references to symbols defined in other compilation units. This is not something that MachO relocations support (see #21972). For this reason we disable the optimisation on Darwin. We do so without a warning since this flag is enabled by `-O2`. Another way to address this issue would be to rather implement a PLT-relocatable jump-table strategy. However, this would only benefit Darwin and does not seem worth the effort. Closes #21972.
* compiler: properly handle ForeignHints in the wasm NCGCheng Shao2023-01-281-13/+52
| | | | | Properly handle ForeignHints of ccall arguments/return value, insert sign extends and truncations when handling signed subwords. Fixes #22852.
* Assorted changes to avoid Data.List.{head,tail}Bodigrim2023-01-2811-31/+32
|
* compiler: fix lowering of CmmBlock in the wasm NCGCheng Shao2023-01-281-0/+2
| | | | | | | The CmmBlock datacon was not handled in lower_CmmLit, since I thought it would have been eliminated after proc-point splitting. Turns out it still occurs in very rare occasions, and this patch is needed to fix T9329 for wasm.
* compiler: fix subword literal narrowing logic in the wasm NCGCheng Shao2023-01-284-20/+15
| | | | | | This patch fixes the W8/W16 literal narrowing logic in the wasm NCG, which used to lower it to something like i32.const -1, without properly zeroing-out the unused higher bits. Fixes #22608.
* Document differences between Data.{Monoid,Semigroup}.{First,Last}Bodigrim2023-01-282-2/+28
|
* hadrian: Fix library-dirs, dynamic-library-dirs and static-library-dirs in ↵Matthew Pickering2023-01-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inplace .conf files Previously we were just throwing away the contents of the library-dirs fields but really we have to do the same thing as for include-dirs, relativise the paths into the current working directory and maintain any extra libraries the user has specified. Now the relevant section of the rts.conf file looks like: ``` library-dirs: ${pkgroot}/../rts/build ${pkgroot}/../../..//_build/stage1/rts/build /nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib /nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib library-dirs-static: ${pkgroot}/../rts/build ${pkgroot}/../../..//_build/stage1/rts/build /nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib /nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib dynamic-library-dirs: ${pkgroot}/../rts/build ${pkgroot}/../../..//_build/stage1/rts/build /nix/store/av4c0fib4rkmb6sa1074z0rb1ciria5b-gperftools-2.10/lib /nix/store/2infxahfp9lj084xn3q9ib5ajks8447i-libffi-3.4.4/lib ``` Fixes #22209
* Convert diagnostics in GHC.Rename.Bind to proper TcRnMessage (#20115)Andrei Borzenkov2023-01-2831-113/+419
| | | | | | | | | | | | | | | | I removed all occurrences of TcRnUnknownMessage in GHC.Rename.Bind module. Instead, these TcRnMessage messages were introduced: TcRnMultipleFixityDecls TcRnIllegalPatternSynonymDecl TcRnIllegalClassBiding TcRnOrphanCompletePragma TcRnEmptyCase TcRnNonStdGuards TcRnDuplicateSigDecl TcRnMisplacedSigDecl TcRnUnexpectedDefaultSig TcRnBindInBootFile TcRnDuplicateMinimalSig
* Add Foldable1 Solo instanceOleg Grenrus2023-01-281-0/+9
|
* CApiFFI: add ConstPtr for encoding const-qualified pointer return typesnineonine2023-01-2813-8/+118
| | | | | | | | | | | | | Previously, when using `capi` calling convention in foreign declarations, code generator failed to handle const-cualified pointer return types. This resulted in CC toolchain throwing `-Wincompatible-pointer-types-discards-qualifiers` warning. `Foreign.C.Types.ConstPtr` newtype was introduced to handle these cases - special treatment was put in place to generate appropritetly qualified C wrapper that no longer triggers the above mentioned warning. Fixes #22043.
* Revert "CApiFFI: add ConstPtr for encoding const-qualified pointer return ↵Ben Gamari2023-01-289-62/+5
| | | | | | types (#22043)" This reverts commit 99aca26b652603bc62953157a48e419f737d352d.
* rts: Drop long-dead fallback definitions for INFINITY & NANBen Gamari2023-01-271-21/+0
| | | | These are no longer necessary since we now compile as C99.
* rts: Fix typoBen Gamari2023-01-273-3/+3
| | | | "tracingAddCapabilities" was mis-named
* rts: Fix C++ compilation issuesBen Gamari2023-01-274-3/+7
| | | | | Make the RTS compilable with a C++ compiler by inserting necessary casts.
* rts: Fix non-atomic mutation of enabled_capabilitiesBen Gamari2023-01-271-1/+2
|
* testsuite: Make listThreads more robustBen Gamari2023-01-272-6/+10
| | | | | Previously it was sensitive to the labels of threads which it did not create (e.g. the IO manager event loop threads). Fix this.
* testsuite: Fix race in UnliftedTVar2Ben Gamari2023-01-272-2/+7
| | | | | | | | | Previously UnliftedTVar2 would fail when run with multiple capabilities (and possibly even with one capability) as it would assume that `killThread#` would immediately kill the "increment" thread. Also, refactor the the executable to now succeed with no output and fails with an exit code.
* rts: Relax Messages assertionBen Gamari2023-01-271-2/+4
| | | | | | | `doneWithMsgThrowTo` was previously too strict in asserting that the `Message` is locked. Specifically, it failed to consider that the `Message` may not be locked if we are deleting all threads during RTS shutdown.
* testsuite: Introduce threaded2_sanity wayBen Gamari2023-01-271-1/+3
| | | | | Incredibly, we previously did not have a single way which would test the threaded RTS with multiple capabilities and the sanity-checker enabled.
* Put hadrian bootstrap plans through `jq`John Ericson2023-01-279-9/+2080
| | | | | This makes it possible to review changes with conventional diffing tools.
* bindist configure: Fail if find not found (#22691)Zubin Duggal2023-01-271-0/+4
|
* Accept an orphan declaration (sadly)Simon Peyton Jones2023-01-272-0/+8
| | | | | | | | | | This accepts the orphan type family instance type instance DsForeignHook = ... in GHC.HsToCore.Types. See Note [The Decoupling Abstract Data Hack] in GHC.Driver.Hooks
* Avoid orphans in the parserSimon Peyton Jones2023-01-272-5/+6
| | | | | This moves Anno instances for PatBuilder from GHC.Parser.PostProcess to GHC.Parser.Types to avoid orphans.
* Avoid orphans in STGSimon Peyton Jones2023-01-2710-111/+149
| | | | | | | This patch removes some orphan instances in the STG namespace by introducing the GHC.Stg.Lift.Types module, which allows various type family instances to be moved to GHC.Stg.Syntax, avoiding orphan instances.
* Report family instance orphans correctlySimon Peyton Jones2023-01-2728-150/+269
| | | | | | | | | | | | | | | | | This fixes the fact that we were not reporting orphan family instances at all. The fix here is easy, but touches a bit of code. I refactored the code to be much more similar to the way that class instances are done: - Add a fi_orphan field to FamInst, like the is_orphan field in ClsInst - Make newFamInst initialise this field, just like newClsInst - And make newFamInst report a warning for an orphan, just like newClsInst - I moved newFamInst from GHC.Tc.Instance.Family to GHC.Tc.Utils.Instantiate, just like newClsInst. - I added mkLocalFamInst to FamInstEnv, just like mkLocalClsInst in InstEnv - TcRnOrphanInstance and SuggestFixOrphanInstance are now parametrised over class instances vs type/data family instances. Fixes #19773
* Detect family instance orphans correctlySimon Peyton Jones2023-01-2713-22/+67
| | | | | | | | | We were treating a type-family instance as a non-orphan if there was a type constructor on its /right-hand side/ that was local. Boo! Utterly wrong. With this patch, we correctly check the /left-hand side/ instead! Fixes #22717
* Revert "base: NoImplicitPrelude in Data.Void and Data.Kind"Matthew Pickering2023-01-272-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes CI errors of the form. ``` ===> Command failed with error code: 1 ghc: panic! (the 'impossible' happened) GHC version 9.7.20230127: lookupGlobal Failed to load interface for ‘GHC.Num.BigNat’ There are files missing in the ‘ghc-bignum’ package, try running 'ghc-pkg check'. Use -v (or `:set -v` in ghci) to see a list of the files searched for. Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/GHC/Utils/Panic.hs:189:37 in ghc:GHC.Utils.Panic pprPanic, called at compiler/GHC/Tc/Utils/Env.hs:154:32 in ghc:GHC.Tc.Utils.Env CallStack (from HasCallStack): panic, called at compiler/GHC/Utils/Error.hs:454:29 in ghc:GHC.Utils.Error Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug ``` This reverts commit d0d7ba0fb053ebe7f919a5932066fbc776301ccd. The module now lacks a dependency on GHC.Num.BigNat which it implicitly depends on. It is causing all CI jobs to fail so we revert without haste whilst the patch can be fixed. Fixes #22848
* Replace errors from badOrigBinding with new one (#22839)Andrei Borzenkov2023-01-2710-70/+57
| | | | | | | | | | | | | | | | | | | | Problem: in 02279a9c the type-level [] syntax was changed from a built-in name to an alias for the GHC.Types.List constructor. badOrigBinding assumes that if a name is not built-in then it must have come from TH quotation, but this is not necessarily the case with []. The outdated assumption in badOrigBinding leads to incorrect error messages. This code: data [] Fails with "Cannot redefine a Name retrieved by a Template Haskell quote: []" Unfortunately, there is not enough information in RdrName to directly determine if the name was constructed via TH or by the parser, so this patch changes the error message instead. It unifies TcRnIllegalBindingOfBuiltIn and TcRnNameByTemplateHaskellQuote into a new error TcRnBindingOfExistingName and changes its wording to avoid guessing the origin of the name.
* rts: Use C11-compliant static assertion syntaxBen Gamari2023-01-271-1/+4
| | | | | | | Previously we used `static_assert` which is only available in C23. By contrast, C11 only provides `_Static_assert`. Fixes #22777
* Fix spurious change from !9568Sylvain Henry2023-01-261-1/+1
|
* base: Make changelog proposal references more consistentBen Gamari2023-01-261-29/+31
| | | | Addresses #22773.
* rel-eng: Add missing rocky8 bindistMatthew Pickering2023-01-261-0/+1
| | | | | We intend to release rocky8 bindist so the fetching script needs to know about them.
* ci: Add ubuntu18_04 nightly and release jobsMatthew Pickering2023-01-264-1/+124
| | | | | | | This adds release jobs for ubuntu18_04 which uses glibc 2.27 which is older than the 2.28 which is used by Rocky8 bindists. Ticket #22268
* base: NoImplicitPrelude in Data.Void and Data.KindVladislav Zavialov2023-01-262-1/+3
| | | | | This change removes an unnecessary dependency on Prelude from two modules in the base package.
* tryFillBuffer: strictifydoyougnu2023-01-261-10/+10
| | | | more speculative bangs
* Do newtype unwrapping in the canonicaliser and rewriterRichard Eisenberg2023-01-268-79/+215
| | | | | | See Note [Unwrap newtypes first], which has the details. Close #22519.
* Hadrian: fix doc generationSylvain Henry2023-01-262-3/+18
| | | | | Was missing dependencies on files generated by templates (e.g. ghc.cabal)