summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove tracing OPTIONS_GHCwip/remove-trace-stgMatthew Pickering2023-02-011-1/+0
| | | | These were accidentally left over from !9542
* compiler: properly handle non-word-sized CmmSwitch scrutinees in the wasm NCGwip/T21776Cheng Shao2023-01-315-1/+49
| | | | | | | | Currently, the wasm NCG has an implicit assumption: all CmmSwitch scrutinees are 32-bit integers. This is not always true; #22864 is one counter-example with a 64-bit scrutinee. This patch fixes the logic by explicitly converting the scrutinee to a word that can be used as a br_table operand. Fixes #22871. Also includes a regression test.
* Bump transformers submodule to 0.6.0.6Ben Gamari2023-01-311-0/+0
| | | | Fixes #22862.
* hadrian: Substitute LIBRARY_*_VERSION variablesBen Gamari2023-01-312-2/+18
| | | | | | | This teaches Hadrian to substitute the `LIBRARY_*_VERSION` variables in `libraries/prologue.txt`, fixing #22714. Fixes #22714.
* hadrian: Refactor templating logicBen Gamari2023-01-311-61/+90
| | | | | | This refactors Hadrian's autoconf-style templating logic to be explicit about which interpolation variables should be substituted in which files. This clears the way to fix #22714 without incurring rule cycles.
* hadrian: Sphinx docs require templated cabal filesBen Gamari2023-01-311-2/+15
| | | | | | | The package-version discovery logic in `doc/users_guide/package_versions.py` uses packages' cabal files to determine package versions. Teach Sphinx about these dependencies in cases where the cabal files are generated by templates.
* Revert "Hadrian: fix doc generation"Ben Gamari2023-01-312-18/+3
| | | | | | This is too large of a hammer. This reverts commit 5640cb1d84d3cce4ce0a9e90d29b2b20d2b38c2f.
* testsuite: Add regression test for #22798Ben Gamari2023-01-312-0/+376
|
* nativeGen/AArch64: Fix graph-colouring allocatorBen Gamari2023-01-311-1/+10
| | | | | | | | Previously various `Instr` queries used by the graph-colouring allocator failed to handle a few pseudo-instructions. This manifested in compiler panicks while compiling `SHA`, which uses `-fregs-graph`. Fixes #22798.
* nativeGen: Teach graph-colouring allocator that x18 is unusableBen Gamari2023-01-311-4/+2
| | | | | | | | Previously trivColourable for AArch64 claimed that at 18 registers were trivially-colourable. This is incorrect as x18 is reserved by the platform on AArch64/Darwin. See #22798.
* nativeGen/AArch64: Fix debugging outputBen Gamari2023-01-311-10/+68
| | | | | | | Previously various panics would rely on a half-written Show instance, leading to very unhelpful errors. Fix this. See #22798.
* Revert "Cmm Lint: relax SIMD register assignment check"sheaf2023-01-311-14/+1
| | | | | | This reverts commit 3be48877, which weakened a Cmm Lint check involving SIMD vectors. Now that we keep track of the type a global register is used at, we can restore the original stronger check.
* Cmm: track the type of global registerssheaf2023-01-3140-617/+671
| | | | | | | | | | | | This patch tracks the type of Cmm global registers. This is needed in order to lint uses of polymorphic registers, such as SIMD vector registers that can be used both for floating-point and integer values. This changes allows us to refactor VanillaReg to not store VGcPtr, as that information is instead stored in the type of the usage of the register. Fixes #22297
* configure: Always create the VERSION fileBen Gamari2023-01-313-7/+4
| | | | | | | | Teach the `configure` script to create the `VERSION` file. This will serve as the stable interface to allow the user to determine the version number of a working tree. Fixes #22322.
* Support "unusable UNPACK pragma" warning with -O0Krzysztof Gogolewski2023-01-3110-31/+71
| | | | Fixes #11270
* Improve exprOkForSpeculation for classopsSimon Peyton Jones2023-01-3121-80/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes #22745 and #15205, which are about GHC's failure to discard unnecessary superclass selections that yield coercions. See GHC.Core.Utils Note [exprOkForSpeculation and type classes] The main changes are: * Write new Note [NON-BOTTOM_DICTS invariant] in GHC.Core, and refer to it * Define new function isTerminatingType, to identify those guaranteed-terminating dictionary types. * exprOkForSpeculation has a new (very simple) case for ClassOpId * ClassOpId has a new field that says if the return type is an unlifted type, or a terminating type. This was surprisingly tricky to get right. In particular note that unlifted types are not terminating types; you can write an expression of unlifted type, that diverges. Not so for dictionaries (or, more precisely, for the dictionaries that GHC constructs). Metric Decrease: LargeRecord
* FastString: add fastStringToShorTextdoyougnu2023-01-312-19/+23
|
* InfoTableProv: ShortText --> ShortByteStringdoyougnu2023-01-311-17/+20
|
* testsuite: use tgamma for cg007Cheng Shao2023-01-311-3/+2
| | | | | | gamma is a glibc-only deprecated function, use tgamma instead. It's required for fixing cg007 when testing the wasm unregisterised codegen.
* Update note at beginning of GHC.Builtin.NAmesJoachim Breitner2023-01-311-7/+9
| | | | some things have been renamed since it was written, it seems.
* rts: prevent potential divide-by-zero when tickInterval=0Cheng Shao2023-01-311-4/+5
| | | | | | This patch fixes a few places in RtsFlags.c that may result in divide-by-zero error when tickInterval=0, which is the default on wasm. Fixes #22603.
* Fixes for cabal-reinstall CI jobMatthew Pickering2023-01-318-23/+24
| | | | | | | | * Allow filepath to be reinstalled * Bump some version bounds to allow newer versions of libraries * Rework testing logic to avoid "install --lib" and package env files Fixes #22344
* 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.