summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Bump ci-images commit to latest masterwip/bump-ci-images-2Matthew Pickering2023-03-301-1/+1
|
* 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.
* 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.
* Modify ThreadId documentation and commentsDavid Feuer2023-03-251-7/+3
| | | | | | | | | | | | | | | | | | | | | | For a long time, `GHC.Conc.Sync` has said ```haskell -- ToDo: data ThreadId = ThreadId (Weak ThreadId#) -- But since ThreadId# is unlifted, the Weak type must use open -- type variables. ``` We are now actually capable of using `Weak# ThreadId#`, but the world has moved on. To support the `Show` and `Ord` instances, we'd need to store the thread ID number in the `ThreadId`. And it seems very difficult to continue to support `threadStatus` in that regime, since it needs to be able to explain how threads died. In addition, garbage collection of weak references can be quite expensive, and it would be hard to evaluate the cost over he whole ecosystem. As discussed in [this CLC issue](https://github.com/haskell/core-libraries-committee/issues/125), it doesn't seem very likely that we'll actually switch to weak references here.
* fix: account for large and compact object stats with nonmoving gcTeo Camarasu2023-03-255-7/+36
| | | | | | | Make sure that we keep track of the size of large and compact objects that have been moved onto the nonmoving heap. We keep track of their size and add it to the amount of live bytes in nonmoving segments to get the total size of the live nonmoving heap. Resolves #17574
* Add regression test for #17574Teo Camarasu2023-03-253-0/+44
| | | | This test currently fails in the nonmoving way
* base: Document GHC versions associated with past base versions in the changelogLi-yao Xia2023-03-251-1/+8
|
* codeGen/tsan: Disable instrumentation of unaligned storesBen Gamari2023-03-241-8/+7
| | | | | | | | | | There is some disagreement regarding the prototype of `__tsan_unaligned_write` (specifically whether it takes just the written address, or the address and the value as an argument). Moreover, I have observed crashes which appear to be due to it. Disable instrumentation of unaligned stores as a temporary mitigation. Fixes #23096.
* User's guide: Improve docs for -WallJoachim Breitner2023-03-241-22/+14
| | | | | | previously it would list the warnings _not_ enabled by -Wall. That’s unnecessary round-about and was out of date. So let's just name the relevant warnings (based on `compiler/GHC/Driver/Flags.hs`).
* nativeGen/AArch64: Fix bitmask immediate predicateBen Gamari2023-03-241-15/+35
| | | | | | | | | Previously the predicate for determining whether a logical instruction operand could be encoded as a bitmask immediate was far too conservative. This meant that, e.g., pointer untagged required five instructions whereas it should only require one. Fixes #23030.
* Move mention of warning groups change to 9.8.1 release notesAdam Gundry2023-03-242-5/+5
|
* Allow WARNING pragmas to be controlled with custom categoriesAdam Gundry2023-03-2439-94/+649
| | | | | | | | | | | | | | | | Closes #17209. This implements GHC Proposal 541, allowing a WARNING pragma to be annotated with a category like so: {-# WARNING in "x-partial" head "This function is undefined on empty lists." #-} The user can then enable, disable and set the severity of such warnings using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There is a new warning group `-Wextended-warnings` containing all these warnings. Warnings without a category are treated as if the category was `deprecations`, and are (still) controlled by the flags `-Wdeprecations` and `-Wwarnings-deprecations`. Updates Haddock submodule.
* Add structured error messages for GHC.Tc.TyCl.PatSynTorsten Schmits2023-03-2314-60/+175
| | | | | | | | | Tracking ticket: #20117 MR: !10158 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Update changelog to mention changes to instance Foldable (Compose f g)Bodigrim2023-03-231-0/+2
|
* Simplify minimum/maximum in instance Foldable (Compose f g)Bodigrim2023-03-231-6/+2
|
* Additional optimized versionsArmando Ramirez2023-03-231-3/+18
|
* Optimized Foldable methods for Data.Functor.ComposeArmando Ramirez2023-03-231-0/+7
| | | | | | Explicitly define length, elem, etc. in Foldable instance for Data.Functor.Compose Implementation of https://github.com/haskell/core-libraries-committee/issues/57
* Testsuite: use js_skip for T2615 (#22374)Sylvain Henry2023-03-221-1/+3
|
* Add structured error messages for GHC.Tc.Utils.TcMTypeTorsten Schmits2023-03-2226-82/+152
| | | | | | | | | Tracking ticket: #20119 MR: !10138 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* Refactor the constraint solver pipelinewip/T23070Simon Peyton Jones2023-03-2214-4162/+4302
| | | | | | | | | | | | | | | | The big change is to put the entire type-equality solver into GHC.Tc.Solver.Equality, rather than scattering it over Canonical and Interact. Other changes * EqCt becomes its own data type, a bit like QCInst. This is great because EqualCtList is then just [EqCt] * New module GHC.Tc.Solver.Dict has come of the class-contraint solver. In due course it will be all. One step at a time. This MR is intended to have zero change in behaviour: it is a pure refactor. It opens the way to subsequent tidying up, we believe.
* Testsuite: use req_interp predicate for T20214Sylvain Henry2023-03-221-1/+1
|
* Testsuite: use req_interp predicate for T16318 (#22370)Sylvain Henry2023-03-221-1/+1
|
* fix: Incorrect @since annotations in GHC.TypeErrorromes2023-03-222-5/+5
| | | | Fixes #23128
* Testsuite: use appropriate predicate for ManyUbxSums test (#22576)Sylvain Henry2023-03-221-1/+1
|
* Be more careful about quantificationSimon Peyton Jones2023-03-2227-195/+272
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This MR is driven by #23051. It does several things: * It is guided by the generalisation plan described in #20686. But it is still far from a complete implementation of that plan. * Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind. This explains that we don't (yet, pending #20686) directly prevent generalising over escaping kinds. * In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep and Multiplicity variables, beause we don't want to quantify over them. We want to do the same for a Concrete tyvar, but there is nothing sensible to default it to (unless it has kind RuntimeRep, in which case it'll be caught by an earlier case). So we promote instead. * Pure refactoring in GHC.Tc.Solver: * Rename decideMonoTyVars to decidePromotedTyVars, since that's what it does. * Move the actual promotion of the tyvars-to-promote from `defaultTyVarsAndSimplify` to `decidePromotedTyVars`. This is a no-op; just tidies up the code. E.g then we don't need to return the promoted tyvars from `decidePromotedTyVars`. * A little refactoring in `defaultTyVarsAndSimplify`, but no change in behaviour. * When making a TauTv unification variable into a ConcreteTv (in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name of the type variable. This just improves error messages. * Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
* Compute LambdaFormInfo when using JavaScript backend.Luite Stegeman2023-03-215-8/+21
| | | | | | | | | | | CmmCgInfos is needed to write interface files, but the JavaScript backend does not generate it, causing "Name without LFInfo" warnings. This patch adds a conservative but always correct CmmCgInfos when the JavaScript backend is used. Fixes #23053
* Allow LLVM backend to use HDoc for faster file generation.Alex Mason2023-03-218-348/+524
| | | | | | Also remove the MetaStmt constructor from LlvmStatement and places the annotations into the Store statement. Includes “Implement a workaround for -no-asm-shortcutting bug“ (https://gitlab.haskell.org/ghc/ghc/-/commit/2fda9e0df886cc551e2cd6b9c2a384192bdc3045)
* Document pdep / pext primopsBodigrim2023-03-211-10/+59
|
* Add structured error messages for GHC.Tc.Utils.EnvTorsten Schmits2023-03-2129-115/+270
| | | | | | | | | Tracking ticket: #20119 MR: !10129 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
* docs: add WALL_CLOCK_TIME event in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+12
|
* docs: add TASK_DELETE event in eventlog encodingsAdam Sandberg Ericsson2023-03-211-0/+9
|