summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix DsUselessSpecialiseForClassMethodSelector msgwip/T21851Simon Peyton Jones2022-11-101-1/+1
| | | | | The error message for DsUselessSpecialiseForClassMethodSelector was just wrong (a typo in some earlier work); trivial fix
* Make indexError work betterSimon Peyton Jones2022-11-102-3/+24
| | | | | | | | | | | | | | | The problem here is described at some length in Note [Boxity for bottoming functions] and Note [Reboxed crud for bottoming calls] in GHC.Core.Opt.DmdAnal. This patch adds a SPECIALISE pragma for indexError, which makes it much less vulnerable to the problem described in these Notes. (This came up in another line of work, where a small change made indexError do reboxing (in nofib/spectral/simple/table_sort) that didn't happen before my change. I've opened #22404 to document the fagility.
* Fire RULES in the SpecialiserSimon Peyton Jones2022-11-1017-237/+521
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Specialiser has, for some time, fires class-op RULES in the specialiser itself: see Note [Specialisation modulo dictionary selectors] This MR beefs it up a bit, so that it fires /all/ RULES in the specialiser, not just class-op rules. See Note [Fire rules in the specialiser] The result is a bit more specialisation; see test simplCore/should_compile/T21851_2 This pushed me into a bit of refactoring. I made a new data types GHC.Core.Rules.RuleEnv, which combines - the several source of rules (local, home-package, external) - the orphan-module dependencies in a single record for `getRules` to consult. That drove a bunch of follow-on refactoring, including allowing me to remove cr_visible_orphan_mods from the CoreReader data type. I moved some of the RuleBase/RuleEnv stuff into GHC.Core.Rule. The reorganisation in the Simplifier improve compile times a bit (geom mean -0.1%), but T9961 is an outlier Metric Decrease: T9961
* GHCi tags generation phase 2Hécate Moonlight2022-11-091-1/+1
| | | | see #19884
* Use TcRnDiagnostic in GHC.Tc.TyCl.Instance (#20117)Giles Anderson2022-11-0948-110/+257
| | | | | | | | | | | | The following `TcRnDiagnostic` messages have been introduced: TcRnWarnUnsatisfiedMinimalDefinition TcRnMisplacedInstSig TcRnBadBootFamInstDeclErr TcRnIllegalFamilyInstance TcRnAssocInClassErr TcRnBadFamInstDecl TcRnNotOpenFamily
* Document what Alternative/MonadPlus instances actually doJade Lovelace2022-11-082-8/+26
|
* Add example for (<$)Jade Lovelace2022-11-081-0/+9
|
* Clarify msum/asum documentationJade Lovelace2022-11-081-2/+8
|
* Fix TypeData issues (fixes #22315 and #22332)Ross Paterson2022-11-0828-74/+261
| | | | | | | | | | | | | | | | | | | | | | | | There were two bugs here: 1. Treating type-level constructors as PromotedDataCon doesn't always work, in particular because constructors promoted via DataKinds are called both T and 'T. (Tests T22332a, T22332b, T22315a, T22315b) Fix: guard these cases with isDataKindsPromotedDataCon. 2. Type-level constructors were sent to the code generator, producing things like constructor wrappers. (Tests T22332a, T22332b) Fix: test for them in isDataTyCon. Other changes: * changed the marking of "type data" DataCon's as suggested by SPJ. * added a test TDGADT for a type-level GADT. * comment tweaks * change tcIfaceTyCon to ignore IfaceTyConInfo, so that IfaceTyConInfo is used only for pretty printing, not for typechecking. (SPJ)
* Define `Infinite` list and use where appropriate.M Farkas-Dyck2022-11-0821-89/+300
| | | | | | | | Also add perf test for infinite list fusion. In particular, in `GHC.Core`, often we deal with infinite lists of roles. Also in a few locations we deal with infinite lists of names. Thanks to simonpj for helping to write the Note [Fusion for `Infinite` lists].
* bump llvm upper boundCarter Schonwald2022-11-071-1/+1
|
* Bump haskeline submodulewip/bump-boot-librariesCheng Shao2022-11-061-0/+0
| | | | Includes a fix for wasm support, doesn't impact other targets.
* Bump gmp-tarballs submoduleCheng Shao2022-11-061-0/+0
| | | | Includes a fix for wasm support, doesn't impact other targets.
* Bump ci-images revisionCheng Shao2022-11-061-1/+1
| | | | ci-images has recently been updated, including changes needed for wasm32-wasi CI.
* Bump Win32 submodule to 2.13.4.0Matthew Pickering2022-11-053-2/+2
| | | | Fixes #22098
* Bump unix submodule to 2.8.0.0Matthew Pickering2022-11-055-4/+9
| | | | | | | | | | Also bumps process and ghc-boot bounds on unix. For hadrian, when cross-compiling, we add -Wwarn=unused-imports -Wwarn=unused-top-binds to validation flavour. Further fixes in unix and/or hsc2hs is needed to make it completely free of warnings; for the time being, this change is needed to unblock other cross-compilation related work.
* Minor refactor around FastStringsKrzysztof Gogolewski2022-11-0536-95/+102
| | | | | | | Pass FastStrings to functions directly, to make sure the rule for fsLit "literal" fires. Remove SDoc indirection in GHCi.UI.Tags and GHC.Unit.Module.Graph.
* CI: Allow hadrian-ghc-in-ghci to run in nightliesBryan Richter2022-11-041-1/+4
| | | | | | | Since lint-submods doesn't run in nightlies, hadrian-ghc-in-ghci needs to mark it as "optional" so it can run if the job doesn't exist. Fixes #22396.
* Export pprTrace and friends from GHC.Prelude.Andreas Klebinger2022-11-0369-127/+146
| | | | | Introduces GHC.Prelude.Basic which can be used in modules which are a dependency of the ppr code.
* Fix haddocks for GHC.IORefBodigrim2022-11-031-2/+2
|
* Clarify status of bindings in WholeCoreBindingsMatthew Pickering2022-11-032-5/+5
| | | | | | | | | Gergo points out that these bindings are tidied, rather than prepd as the variable claims. Therefore we update the name of the variable to reflect reality and add a comment to the data type to try to erase any future confusion. Fixes #22307
* git: ignore HIE files.M Farkas-Dyck2022-11-031-0/+2
| | | | Cleans up git status if one sets -fwrite-ide-info in hadrian/ghci.
* Port foundation numeric tests to GHC testsuiteMatthew Pickering2022-11-033-0/+838
| | | | | | | | | | | | | This commit ports the numeric tests which found a regression in GHC-9.4. https://github.com/haskell-foundation/foundation/issues/571 Included in the commit is a simple random number generator and simplified QuickCheck implementation. In future these could be factored out of this standalone file and reused as a general purpose library which could be used for other QuickCheck style tests in the testsuite. See #22282
* gen-dll: Drop itBen Gamari2022-11-035-562/+0
| | | | | | | | | Currently it is only used by the make build system, which is soon to be retired, and it has not built since 41cf758b. We may need to reintroduce it when dynamic-linking support is introduced on Windows, but we will cross that bridge once we get there. Fixes #21753.
* Move Symbol implementation note out of public haddockOleg Grenrus2022-11-021-1/+2
|
* rts: tag `stgStrndup` as `STG_MALLOC`Nicolas Trangez2022-11-021-1/+2
| | | | See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: add and use `STG_RETURNS_NONNULL`Nicolas Trangez2022-11-022-2/+19
| | | | | See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-returns_005fnonnull-function-attribute See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: use `alloc_size` attributeNicolas Trangez2022-11-022-3/+17
| | | | | | | | This patch adds the `STG_ALLOC_SIZE1` and `STG_ALLOC_SIZE2` macros which allow to set the `alloc_size` attribute on functions, when available. See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-alloc_005fsize-function-attribute See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: specify deallocator of allocating functionsNicolas Trangez2022-11-023-6/+50
| | | | | | | | | | | | | This patch adds a new `STG_MALLOC1` macro (and its counterpart `STG_MALLOC2` for completeness) which allows to specify the deallocation function to be used with allocations of allocating functions, and applies it to `stg*allocBytes`. It also fixes a case where `free` was used to free up an `stgMallocBytes` allocation, found by the above change. See: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-malloc-function-attribute See: https://gitlab.haskell.org/ghc/ghc/-/issues/22381
* rts: use `STG_UNUSED`Nicolas Trangez2022-11-022-3/+3
|
* rts: introduce (and use) `STG_MALLOC`Nicolas Trangez2022-11-022-2/+4
| | | | | Instead of using `GNUC3_ATTRIBUTE(__malloc__)`, provide a `STG_MALLOC` macro definition and use it instead.
* rts: introduce (and use) `STG_USED`Nicolas Trangez2022-11-022-4/+5
| | | | | Similar to `STG_UNUSED`, have a specific macro for `__attribute__(used)`.
* rts: consistently use `STG_UNUSED`Nicolas Trangez2022-11-022-2/+2
|
* rts: introduce (and use) `STG_NORETURN`Nicolas Trangez2022-11-0217-24/+26
| | | | | | | Instead of sprinkling the codebase with `GNU(C3)_ATTRIBUTE(__noreturn__)`, add a `STG_NORETURN` macro (for, basically, the same thing) similar to `STG_UNUSED` and others, and update the code to use this macro where applicable.
* Add two tests for #17366Simon Peyton Jones2022-11-017-0/+116
|
* Shrink test case for #22357Simon Peyton Jones2022-11-011-678/+12
| | | | | Ryan Scott offered a cut-down repro case (60 lines instead of more than 700 lines)
* Expose UnitEnvGraphKey for user-codeFendor2022-11-011-0/+1
|
* Add accurate skolem info when quantifyingSimon Peyton Jones2022-11-019-64/+139
| | | | | | | Ticket #22379 revealed that skolemiseQuantifiedTyVar was dropping the passed-in skol_info on the floor when it encountered a SkolemTv. Bad! Several TyCons thereby share a single SkolemInfo on their binders, which lead to bogus error reports.
* ThToHs: fix overzealous parenthesizationVladislav Zavialov2022-11-017-13/+29
| | | | | | | | | | | | | | | | | | Before this patch, when converting from TH.Exp to LHsExpr GhcPs, the compiler inserted more parentheses than required: ((f a) (b + c)) d This was happening because the LHS of the function application was parenthesized as if it was the RHS. Now we use funPrec and appPrec appropriately and produce sensibly parenthesized expressions: f a (b + c) d I also took the opportunity to remove the special case for LamE, which was not special at all and simply duplicated code.
* Typo: rename -fwrite-if-simplfied-core to -fwrite-if-simplified-coreKrzysztof Gogolewski2022-11-015-19/+19
|
* rts: fix OS thread naming in tickerNicolas Trangez2022-11-013-26/+20
| | | | | | | | | | | | | | | Since ee0deb805, the use of `pthread_setname_np` on Darwin was fixed when invoking `createOSThread`. However, the 'ticker' has some thread-creation code which doesn't rely on `createOSThread`, yet also uses `pthread_setname_np`. This patch enforces all thread creation to go through a single function, which uses the (correct) thread-naming code introduced in ee0deb805. See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2 See: https://gitlab.haskell.org/ghc/ghc/-/issues/22206 See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9066
* rts: fix lifetime of `start_thread`s `name` valueNicolas Trangez2022-11-011-8/+14
| | | | | | | | | | Since, unlike the code in ee0deb8054da2^, usage of the `name` value passed to `createOSThread` now outlives said function's lifetime, and could hence be released by the caller by the time the new thread runs `start_thread`, it needs to be copied. See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2#note_460080 See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9066
* rts: `name` argument of `createOSThread` can be `const`Nicolas Trangez2022-11-013-3/+3
| | | | | | | | | | Since we don't intend to ever change the incoming string, declare this to be true. Also, in the POSIX implementation, the argument is no longer `STG_UNUSED` (since ee0deb8054da2a597fc5624469b4c44fd769ada2) in any code path. See: https://gitlab.haskell.org/ghc/ghc/-/commit/ee0deb8054da2a597fc5624469b4c44fd769ada2#note_460080
* Drop a kludge for binutils<2.17, which is now over 10 years old.M Farkas-Dyck2022-11-012-39/+2
|
* Start the deprecation process for GHC.PackHécate Moonlight2022-10-281-0/+5
|
* CI: Don't run lint-submods on nightlywip/T22325Bryan Richter2022-10-281-0/+3
| | | | Fixes #22325
* Minor SDoc-related cleanupKrzysztof Gogolewski2022-10-2822-134/+138
| | | | | | | | | | | * Rename pprCLabel to pprCLabelStyle, and use the name pprCLabel for a function using CStyle (analogous to pprAsmLabel) * Move LabelStyle to the CLabel module, it no longer needs to be in Outputable. * Move calls to 'text' right next to literals, to make sure the text/str rule is triggered. * Remove FastString/String roundtrip in Tc.Deriv.Generate * Introduce showSDocForUser', which abstracts over a pattern in GHCi.UI
* Pass correct package db when testing stage1.Zubin Duggal2022-10-282-2/+2
| | | | It used to pick the db for stage-2 which obviously didn't work.
* Fix broken link to `async` packageEvan Relf2022-10-271-1/+1
|
* Add missing dict binds to specialiserSimon Peyton Jones2022-10-274-14/+741
| | | | | | | | | | I had forgotten to add the auxiliary dict bindings to the /unfolding/ of a specialised function. This caused #22358, which reports failures when compiling Hackage packages fixed-vector indexed-traversable Regression test T22357 is snarfed from indexed-traversable