summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* TH: revert changes to GadtC & RecGadtCsheaf2023-04-0115-66/+79
| | | | | | | Commit 3f374399 included a breaking-change to the template-haskell library when it made the GadtC and RecGadtC constructors take non-empty lists of names. As this has the potential to break many users' packages, we decided to revert these changes for now.
* Improve haddocks of template-haskell Con datatypesheaf2023-04-011-11/+27
| | | | | This adds a bit more information, in particular about the lists of constructors in the GadtC and RecGadtC cases.
* JS: Linker: use saturated JExprdoyougnu2023-04-012-100/+5
| | | | Follow on to MR!10142 in pursuit of #22736
* Add structured error messages for GHC.Tc.TyClTorsten Schmits2023-04-0197-440/+1028
| | | | | | | | | Tracking ticket: #20117 MR: !10183 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* driver: Unit State Data.Map -> GHC.Unique.UniqMapdoyougnu2023-04-0113-159/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In pursuit of #22426. The driver and unit state are major contributors. This commit also bumps the haddock submodule to reflect the API changes in UniqMap. ------------------------- Metric Decrease: MultiComponentModules MultiComponentModulesRecomp T10421 T10547 T12150 T12234 T12425 T13035 T16875 T18140 T18304 T18698a T18698b T18923 T20049 T5837 T6048 T9198 -------------------------
* User Guide: update copyright year: 2020->2023Artem Pelenitsyn2023-04-011-1/+1
|
* [feat] make ($) representation polymorphicmangoiv2023-04-0115-27/+47
| | | | | | | | | | | | | | - this change was approved by the CLC in [1] following a CLC proposal [2] - make ($) representation polymorphic (adjust the type signature) - change ($) implementation to allow additional polymorphism - adjust the haddock of ($) to reflect these changes - add additional documentation to document these changes - add changelog entry - adjust tests (move now succeeding tests and adjust stdout of some tests) [1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854 [2] https://github.com/haskell/core-libraries-committee/issues/132
* Add test for T23184Matthew Pickering2023-03-313-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch: ``` commit 6656f0165a30fc2a22208532ba384fc8e2f11b46 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Fri Jul 23 23:57:01 2021 +0100 A bunch of changes related to eta reduction This is a large collection of changes all relating to eta reduction, originally triggered by #18993, but there followed a long saga. Specifics: ...lots of lines omitted... Other incidental changes * Fix a fairly long-standing outright bug in the ApplyToVal case of GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the tail of 'dmds' in the recursive call, which meant the demands were All Wrong. I have no idea why this has not caused problems before now. ``` Note this "Fix a fairly longstanding outright bug". This is the specific fix ``` @@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds -- let a = ...arg... -- in [...hole...] a -- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable - do { let (dmd:_) = dmds -- Never fails - ; (floats1, cont') <- mkDupableContWithDmds env dmds cont + do { let (dmd:cont_dmds) = dmds -- Never fails + ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont ; let env' = env `setInScopeFromF` floats1 ; (_, se', arg') <- simplArg env' dup se arg ; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg' ``` Ticket #23184 is a report of the bug that this diff fixes.
* testsuite: asyncify the testsuite driverCheng Shao2023-03-303-133/+140
| | | | | | | | | | | | | | This patch refactors the testsuite driver, gets rid of multi-threading logic for running test cases concurrently, and uses asyncio & coroutines instead. This is not yak shaving for its own sake; the previous multi-threading logic is prone to livelock/deadlock conditions for some reason, even if the total number of threads is bounded to a thread pool's capacity. The asyncify change is an internal implementation detail of the testsuite driver and does not impact most GHC maintainers out there. The patch does not touch the .T files, test cases can be added/modified the exact same way as before.
* testsuite: use context variable instead of thread-local variableCheng Shao2023-03-302-7/+7
| | | | | | | | This patch changes a thread-local variable to context variable instead, which works as intended when the testsuite transitions to use asyncio & coroutines instead of multi-threading to concurrently run test cases. Note that this also raises the minimum Python version to 3.7.
* testsuite: mypy typing error fixesCheng Shao2023-03-305-50/+10
| | | | | This patch fixes some mypy typing errors which weren't caught in previous linting jobs.
* testsuite: handle target executable extensionCheng Shao2023-03-301-2/+7
|
* testsuite: strip the cross ghc prefix in output and error messageCheng Shao2023-03-301-0/+6
|
* testsuite: normalize the .wasm extensionCheng Shao2023-03-301-0/+5
|
* testsuite: don't add optllvm way for wasm32Cheng Shao2023-03-301-1/+1
|
* hadrian: Pass CROSS_EMULATOR to runtests.pyBen Gamari2023-03-301-0/+2
|
* testsuite/driver: Normalize away differences in ghc executable nameBen Gamari2023-03-301-0/+12
|
* testsuite/driver: Add basic support for testing cross-compilersBen Gamari2023-03-303-2/+29
|
* ci: use alpine3_17-wasm image for wasm jobsCheng Shao2023-03-303-80/+74
| | | | | Bump the ci-images dependency and use the new alpine3_17-wasm docker image for wasm jobs.
* ci: fix lint-testsuite jobCheng Shao2023-03-301-6/+1
| | | | | | | The list_broken make target will transitively depend on the calibrate.out target, which used STAGE1_GHC instead of TEST_HC. It really should be TEST_HC since that's what get passed in the gitlab CI config.
* ci: unset CROSS_EMULATOR for js jobCheng Shao2023-03-301-0/+2
|
* ci: ensure that all non-i386 pipelines do parallel xz compressionCheng Shao2023-03-301-1/+1
| | | | | | We can safely enable parallel xz compression for non-i386 pipelines. However, previously we didn't export XZ_OPT, so the xz process won't see it if XZ_OPT hasn't already been set in the current job.
* ci: make lint-ci-config job fast againCheng Shao2023-03-303-4/+4
| | | | | | | | We don't pin our nixpkgs revision and tracks the default nixpkgs-unstable channel anyway. Instead of using haskell.packages.ghc924, we should be using haskell.packages.ghc92 to maximize the binary cache hit rate and make lint-ci-config job fast again. Also bumps the nix docker image to the latest revision.
* Add LANGUAGE GADTs to GHC.Rename.Env sheaf2023-03-301-1/+1
| | | | | We need to enable this extension for the file to compile with ghc 9.2, as we are pattern matching on a GADT and this required the GADT extension to be enabled until 9.4.
* docs: move RecordUpd changelog entry to 9.8sheaf2023-03-302-5/+5
| | | | This was accidentally included in the 9.6 changelog instead of the 9.6 changelog.
* Proxies for head and tail: review suggestionssheaf2023-03-301-6/+5
|
* Fix testsBodigrim2023-03-3047-6/+49
|
* Bump submodulesBodigrim2023-03-303-1/+2
|
* Fixes to accomodate Data.List.{head,tail} with {-# WARNING #-}Bodigrim2023-03-305-6/+34
|
* Add {-# WARNING #-} to Data.List.{head,tail}Bodigrim2023-03-302-0/+7
|
* Revert "ghc-heap: remove wrong Addr# coercion (#23181)"Matthew Pickering2023-03-303-13/+14
| | | | | | | | This reverts commit f4f1f14f8009c3c120b8b963ec130cbbc774ec02. This fails to build with GHC-9.2 as a boot compiler. See #23195 for tracking this issue.
* testsuite: Fix racing prints in T21465Ben Gamari2023-03-303-2/+5
| | | | | | | As noted in #23155, we previously failed to add flushes necessary to ensure predictable output. Fixes #23155.
* ghc-heap: remove wrong Addr# coercion (#23181)Sylvain Henry2023-03-303-14/+13
| | | | | | Conversion from Addr# to I# isn't correct with the JS backend. Also used the opportunity to reenable 64-bit Word/Int tests
* js: split JMacro into JS eDSL and JS syntaxdoyougnu2023-03-3031-455/+888
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: Splits JExpr and JStat into two nearly identical DSLs: - GHC.JS.Syntax is the JMacro based DSL without unsaturation, i.e., a value cannot be unsaturated, or, a value of this DSL is a witness that a value of GHC.JS.Unsat has been saturated - GHC.JS.Unsat is the JMacro DSL from GHCJS with Unsaturation. Then all binary and outputable instances are changed to use GHC.JS.Syntax. This moves us closer to closing out #22736 and #22352. See #22736 for roadmap. ------------------------- Metric Increase: CoOpt_Read LargeRecord ManyAlternatives PmSeriesS PmSeriesT PmSeriesV T10421 T10858 T11195 T11374 T11822 T12227 T12707 T13035 T13253 T13253-spj T13379 T14683 T15164 T15703 T16577 T17096 T17516 T17836 T18140 T18282 T18304 T18478 T18698a T18698b T18923 T1969 T19695 T20049 T21839c T3064 T4801 T5321FD T5321Fun T5631 T5642 T783 T9198 T9233 T9630 TcPlugin_RewritePerf WWRec -------------------------
* hadrian: Fix path to HpcParser.yMatthew Pickering2023-03-291-1/+1
| | | | | | | The source for this project has been moved into a src/ folder so we also need to update this path. Fixes #23187
* igre_prompt_env: discard "only-qualified" namessheaf2023-03-294-10/+27
| | | | | | | | | | | | | | | We were unnecessarily carrying around names only available qualified in igre_prompt_env, violating the icReaderEnv invariant. We now get rid of these, as they aren't needed for the shadowing computation that igre_prompt_env exists for. Fixes #23177 ------------------------- Metric Decrease: T14052 T14052Type -------------------------
* Avoid repeatedly shadowing in shadowNamessheaf2023-03-292-40/+154
| | | | | | | This commit refactors GHC.Type.Name.Reader.shadowNames to first accumulate all the shadowing arising from the introduction of a new set of GREs, and then applies all the shadowing to the old GlobalRdrEnv in one go.
* Handle records in the renamersheaf2023-03-29275-4222/+6237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the field-based logic for disambiguating record updates to the renamer. The type-directed logic, scheduled for removal, remains in the typechecker. To do this properly (and fix the myriad of bugs surrounding the treatment of duplicate record fields), we took the following main steps: 1. Create GREInfo, a renamer-level equivalent to TyThing which stores information pertinent to the renamer. This allows us to uniformly treat imported and local Names in the renamer, as described in Note [GREInfo]. 2. Remove GreName. Instead of a GlobalRdrElt storing GreNames, which distinguished between normal names and field names, we now store simple Names in GlobalRdrElt, along with the new GREInfo information which allows us to recover the FieldLabel for record fields. 3. Add namespacing for record fields, within the OccNames themselves. This allows us to remove the mangling of duplicate field selectors. This change ensures we don't print mangled names to the user in error messages, and allows us to handle duplicate record fields in Template Haskell. 4. Move record disambiguation to the renamer, and operate on the level of data constructors instead, to handle #21443. The error message text for ambiguous record updates has also been changed to reflect that type-directed disambiguation is on the way out. (3) means that OccEnv is now a bit more complex: we first key on the textual name, which gives an inner map keyed on NameSpace: OccEnv a ~ FastStringEnv (UniqFM NameSpace a) Note that this change, along with (2), both increase the memory residency of GlobalRdrEnv = OccEnv [GlobalRdrElt], which causes a few tests to regress somewhat in compile-time allocation. Even though (3) simplified a lot of code (in particular the treatment of field selectors within Template Haskell and in error messages), it came with one important wrinkle: in the situation of -- M.hs-boot module M where { data A; foo :: A -> Int } -- M.hs module M where { data A = MkA { foo :: Int } } we have that M.hs-boot exports a variable foo, which is supposed to match with the record field foo that M exports. To solve this issue, we add a new impedance-matching binding to M foo{var} = foo{fld} This mimics the logic that existed already for impedance-binding DFunIds, but getting it right was a bit tricky. See Note [Record field impedance matching] in GHC.Tc.Module. We also needed to be careful to avoid introducing space leaks in GHCi. So we dehydrate the GlobalRdrEnv before storing it anywhere, e.g. in ModIface. This means stubbing out all the GREInfo fields, with the function forceGlobalRdrEnv. When we read it back in, we rehydrate with rehydrateGlobalRdrEnv. This robustly avoids any space leaks caused by retaining old type environments. Fixes #13352 #14848 #17381 #17551 #19664 #21443 #21444 #21720 #21898 #21946 #21959 #22125 #22160 #23010 #23062 #23063 Updates haddock submodule ------------------------- Metric Increase: MultiComponentModules MultiLayerModules MultiLayerModulesDefsGhci MultiLayerModulesNoCode T13701 T14697 hard_hole_fits -------------------------
* Add COMPLETE pragmas to TypeRep, SSymbol, SChar, and SNatRyan Scott2023-03-286-0/+30
| | | | | This implements [CLC proposal #149](https://github.com/haskell/core-libraries-committee/issues/149).
* Make exprIsConApp_maybe a bit clevererwip/T23159Simon Peyton Jones2023-03-271-8/+54
| | | | | | | | | | | | | | | | | | | | | | | Addresses #23159. See Note Note [Exploit occ-info in exprIsConApp_maybe] in GHC.Core.SimpleOpt. Compile times go down very slightly, but always go down, never up. Good! Metrics: compile_time/bytes allocated ------------------------------------------------ CoOpt_Singletons(normal) -1.8% T15703(normal) -1.2% GOOD geo. mean -0.1% minimum -1.8% maximum +0.0% Metric Decrease: CoOpt_Singletons T15703
* Document the constructor name for listsDavid Feuer2023-03-261-1/+4
| | | | | | | | | Derived `Data` instances use raw infix constructor names when applicable. The `Data.Data [a]` instance, if derived, would have a constructor name of `":"`. However, it actually uses constructor name `"(:)"`. Document this peculiarity. See https://github.com/haskell/core-libraries-committee/issues/147
* Update and expand atomic modification HaddocksDavid Feuer2023-03-262-14/+67
| | | | | | | | | | * The documentation for `atomicModifyIORef` and `atomicModifyIORef'` were incomplete, and the documentation for `atomicModifyIORef` was out of date. Update and expand. * Remove a useless lazy pattern match in the definition of `atomicModifyIORef`. The pair it claims to match lazily was already forced by `atomicModifyIORef2`.
* Add Eq/Ord instances for SSymbol, SChar, and SNatRyan Scott2023-03-253-1/+27
| | | | This implements [CLC proposal #148](https://github.com/haskell/core-libraries-committee/issues/148).
* rts: Fix capability-count check in zeroSlopBen Gamari2023-03-251-3/+2
| | | | | | | | | Previously `zeroSlop` examined `RtsFlags` to determine whether the program was single-threaded. This is wrong; a program may be started with `+RTS -N1` yet the process may later increase the capability count with `setNumCapabilities`. This lead to quite subtle and rare crashes. Fixes #23088.
* rts: Don't rely on EXTERN_INLINE for slop-zeroing logicBen Gamari2023-03-254-23/+47
| | | | | | | | | | | | | Previously we relied on calling EXTERN_INLINE functions defined in ClosureMacros.h from Cmm to zero slop. However, as far as I can tell, this is no longer safe to do in C99 as EXTERN_INLINE definitions may be emitted in each compilation unit. Fix this by explicitly declaring a new set of non-inline functions in ZeroSlop.c which can be called from Cmm and marking the ClosureMacros.h definitions as INLINE_HEADER. In the future we should try to eliminate EXTERN_INLINE.
* Improve documentation for resizing of byte arraysBodigrim2023-03-251-11/+35
|
* testsuite: add the rts_clearMemory test caseCheng Shao2023-03-255-0/+43
| | | | | | This patch adds a standalone test case for rts_clearMemory that mimics how it's typically used by wasm backend users and ensures this RTS API isn't broken by future RTS refactorings. Fixes #23901.
* rts: use performBlockingMajorGC in hs_perform_gc and fix ffi023Cheng Shao2023-03-254-5/+4
| | | | | | | | | | | This patch does a few things: - Add the missing RtsSymbols.c entry of performBlockingMajorGC - Make hs_perform_gc call performBlockingMajorGC, which restores previous behavior - Use hs_perform_gc in ffi023 - Remove rts_clearMemory() call in ffi023, it now works again in some test ways previously marked as broken. Fixes #23089
* Improve documentation of atomicModifyMutVar2#Bodigrim2023-03-251-5/+17
|
* rts: Fix barriers of IND and IND_STATICBen Gamari2023-03-252-9/+11
| | | | | | | | | Previously IND and IND_STATIC lacked the acquire barriers enjoyed by BLACKHOLE. As noted in the (now updated) Note [Heap memory barriers], this barrier is critical to ensure that the indirectee is visible to the entering core. Fixes #22872.