summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix strictness and arity info in SpecConstrwip/T19780Simon Peyton Jones2021-05-067-77/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In GHC.Core.Opt.SpecConstr.spec_one we were giving join-points an incorrect join-arity -- this was fallout from commit c71b220491a6ae46924cc5011b80182bcc773a58 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Thu Apr 8 23:36:24 2021 +0100 Improvements in SpecConstr * Allow under-saturated calls to specialise See Note [SpecConstr call patterns] This just allows a bit more specialisation to take place. and showed up in #19780. I refactored the code to make the new function calcSpecInfo which treats join points separately. In doing this I discovered two other small bugs: * In the Var case of argToPat we were treating UnkOcc as uninteresting, but (by omission) NoOcc as interesting. As a result we were generating SpecConstr specialisations for functions with unused arguments. But the absence anlyser does that much better; doing it here just generates more code. Easily fixed. * The lifted/unlifted test in GHC.Core.Opt.WorkWrap.Utils.mkWorkerArgs was back to front (#19794). Easily fixed. * In the same function, mkWorkerArgs, we were adding an extra argument nullary join points, which isn't necessary. I added a test for this. That in turn meant I had to remove an ASSERT in CoreToStg.mkStgRhs for nullary join points, which was always bogus but now trips; I added a comment to explain.
* hadrian: Don't depend upon bash from PATHBen Gamari2021-05-066-7/+30
| | | | | | | | Previously Hadrian depended implicitly upon whatever `bash` it found in `PATH`, offerring no way for the user to override. Fix this by detecting `sh` in `configure` and passing the result to Hadrian. Fixes #19797.
* Disallow -XDerivingVia when -XSafe is on (#19786)Aaron Allen2021-05-064-1/+23
| | | | | Since `GeneralizedNewtypeDeriving` is considered unsafe, `DerivingVia` should be as well.
* Bump binary submoduleBen Gamari2021-05-061-0/+0
| | | | Fixes #19631.
* rts/posix/GetTime.c: Use Solaris-specific gethrvtime(3) on OpenSolaris ↵PHO2021-05-061-0/+10
| | | | | | derivatives The constant CLOCK_THREAD_CPUTIME_ID is defined in a system header but it isn't acutally usable. clock_gettime(2) always returns EINVAL.
* EPA: properly capture semicolons between Matches in a FunBindAlan Zimmerman2021-05-069-64/+88
| | | | | | | | | | | | | | | For the source module MatchSemis where { a 0 = 1; a _ = 2; } Make sure that the AddSemiAnn entries for the two trailing semicolons are attached to the component Match elements. Closes #19784
* 19486 Nearly all uses of `uniqCompareFS` are dubious and lack a ↵Sasha Bogicevic2021-05-067-10/+17
| | | | non-determinism justification
* Use fix-sized arithmetic primops for fixed size boxed typesJohn Ericson2021-05-063-108/+239
| | | | | | | | | | | We think the compiler is ready, so we can do this for all over the 8-, 16-, and 32-bit boxed types. We are holding off on doing all the primops at once so things are easier to investigate. Metric Decrease: T12545
* Re-introduce Note [keepAlive# magic]Ben Gamari2021-05-063-1/+148
| | | | | | | | Somewhere in the course of forward- and back-porting the keepAlive# branch the Note which described the mechanism was dropped. Reintroduce it. Closes #19712.
* Add an .editorconfig fileHécate Moonlight2021-05-051-0/+14
| | | | closes #19793
* support LiftedRep and UnliftedRep in GHCi FFILuite Stegeman2021-05-054-17/+44
| | | | fixes #19733
* More specific error messages for annotations (fixes #19740)Jaro Reinders2021-05-056-21/+23
|
* test driver: Make sure RESIDENCY_OPTS is passed for 'all' perf testsMatthew Pickering2021-05-053-13/+34
| | | | | | | | | | | | Fixes #19731 ------------------------- Metric Decrease: T11545 Metric Increase: T12545 T15304 -------------------------
* Add some DriverMessage type constructorsAlfredo Di Napoli2021-05-058-106/+270
| | | | | | | | | | | | | | | | | | | | | | | This commit expands the DriverMessage type with new type constructors, making the number of diagnostics GHC can emit richer. In particular: * Add DriverMissingHomeModules message * Add DriverUnusedPackage message * Add DriverUnnecessarySourceImports message This commit adds the `DriverUnnecessarySourceImports` message and fixes a small bug in its reporting: inside `warnUnnecessarySourceImports` we were checking for `Opt_WarnUnusedSourceImports` to be set, but we were emitting the diagnostic with `WarningWithoutFlag`. This also adjusts the T10637 test to reflect that. * Add DriverDuplicatedModuleDeclaration message * Add DriverModuleNotFound message * Add DriverFileModuleNameMismatch message * Add DriverUnexpectedSignature message * Add DriverFileNotFound message * Add DriverStaticPointersNotSupported message * Add DriverBackpackModuleNotFound message
* configure: Move libdw search logic to macroBen Gamari2021-05-052-53/+58
|
* configure: Move libnuma check to macroBen Gamari2021-05-052-57/+61
|
* configure: Move pthreads checks to macroBen Gamari2021-05-052-95/+102
|
* Break up aclocal.m4Ben Gamari2021-05-0569-2742/+2640
|
* Persist CorePrepProv into IfaceUnivCoProvSimon Peyton Jones2021-05-0416-63/+84
| | | | | | | | | | | | | | | | CorePrepProv is only created in CorePrep, so I thought it wouldn't be needed in IfaceUnivCoProv. But actually IfaceSyn is used during pretty-printing, and we can certainly pretty-print things after CorePrep as #19768 showed. So the simplest thing is to represent CorePrepProv in IfaceSyn. To improve what Lint can do I also added a boolean to CorePrepProv, to record whether it is homogeneously kinded or not. It is introduced in two distinct ways (see Note [Unsafe coercions] in GHC.CoreToStg.Prep), one of which may be hetero-kinded (e.g. Int ~ Int#) beause it is casting a divergent expression; but the other is not. The boolean keeps track.
* Tweak function `quantifyType` to fix #12449Roland Senn2021-05-049-38/+75
| | | | | | | | | | | In function `compiler/GHC/Runtime/Heap/Inspect.hs:quantifyType` replace `tcSplitForAllInvisTyVars` by `tcSplitNestedSigmaTys`. This will properly split off the nested foralls in examples like `:print fmap`. Do not remove the `forall`s from the `snd` part of the tuple returned by `quantifyType`. It's not necessary and the reason for the bug in #12449. Some code simplifications at the calling sites of `quantifyTypes`.
* Improve hs-boot binds error (#19781)sheaf2021-05-037-10/+52
|
* visually align expected and actual modules nameiori tsu2021-05-033-3/+3
| | | | | | | | | | | | | | | | | | | | before: > /home/matt/Projects/persistent/persistent/Database/Persist/ImplicitIdDef.hs:1:8: error: > File name does not match module name: > Saw: ‘A.B.Module’ > Expected: ‘A.B.Motule’ > | > 1 | module A.B.Motule > | ^^^^^^^^^^> after: > /home/matt/Projects/persistent/persistent/Database/Persist/ImplicitIdDef.hs:1:8: error: > File name does not match module name: > Saw: ‘A.B.Module’ > Expected: ‘A.B.Motule’ > | > 1 | module A.B.Motule > | ^^^^^^^^^^>
* Disable HLint coloursHécate Moonlight2021-05-031-2/+3
| | | | closes #19776
* Remove duplicate modules in GHCi %s promptPhilipp Dargel2021-05-031-1/+1
| | | | fixes #19757
* pe: enable code unloading for WindowsTamar Christina2021-05-032-6/+3
|
* Update documentation of 'Weak'bit2021-05-031-8/+7
|
* Move shift ops out of GHC.BaseSylvain Henry2021-05-033-66/+72
| | | | | | | With a quick flavour I get: before T12545(normal) ghc/alloc 8628109152 after T12545(normal) ghc/alloc 8559741088
* Use fix-sized bit-fiddling primops for fixed size boxed typesJohn Ericson2021-05-033-80/+145
| | | | | Like !5572, this is switching over a portion of the primops which seems safe to use.
* Add test case for #8144Harry Garrood harry@garrood.me2021-05-035-0/+26
| | | | Fixes #8144
* Make sized division primops ok-for-spec (#19026)Sylvain Henry2021-04-302-14/+47
|
* Bring tcTyConScopedTyVars into scope in tcClassDecl2Ryan Scott2021-04-308-30/+112
| | | | | | | | | | | It is possible that the type variables bound by a class header will map to something different in the typechecker in the presence of `StandaloneKindSignatures`. `tcClassDecl2` was not aware of this, however, leading to #19738. To fix it, in `tcTyClDecls` we map each class `TcTyCon` to its `tcTyConScopedTyVars` as a `ClassScopedTVEnv`. We then plumb that `ClassScopedTVEnv` to `tcClassDecl2` where it can be used. Fixes #19738.
* Hadrian: build check-* with -Wall/-WerrorSylvain Henry2021-04-301-1/+1
| | | | Otherwise CI fails only with make build system.
* Fix genprimopcode warningSylvain Henry2021-04-301-1/+1
|
* Make GHC.Runtime.Interpreter independent of GHC.DriverSylvain Henry2021-04-309-32/+36
|
* Interpreter: replace DynFlags with EvalOpts/BCOOptsSylvain Henry2021-04-304-45/+68
|
* Tighten scope of non-POSIX visibility macrosViktor Dukhovni2021-04-304-15/+34
| | | | | | | The __BSD_VISIBLE and _DARWIN_C_SOURCE macros expose non-POSIX prototypes in system header files. We should scope these to just the ".c" modules that actually need them, and avoid defining them in header files used in other C modules.
* rts: export allocateWrite, freeWrite and markExec #19763Adam Sandberg Ericsson2021-04-291-0/+10
|
* Replace (ptext .. sLit) with `text`Sylvain Henry2021-04-2955-818/+789
| | | | | | | | | | | | | | | 1. `text` is as efficient as `ptext . sLit` thanks to the rewrite rules 2. `text` is visually nicer than `ptext . sLit` 3. `ptext . sLit` encourages using one `ptext` for several `sLit` as in: ptext $ case xy of ... -> sLit ... ... -> sLit ... which may allocate SDoc's TextBeside constructors at runtime instead of sharing them into CAFs.
* Propagate free variables in extract_lctxt correctlyRyan Scott2021-04-293-1/+27
| | | | | This fixes an oversight in the implementation of `extract_lctxt` which was introduced in commit ce85cffc. Fixes #19759.
* Expand synonyms in mkCastTy when necessaryRyan Scott2021-04-293-20/+72
| | | | | | | | Doing so is important to maintain invariants (EQ3) and (EQ4) from `Note [Respecting definitional equality]` in `GHC.Core.TyCo.Rep`. For the details, see the new `Note [Using coreView in mk_cast_ty]`. Fixes #19742.
* Redesign withDict (formerly magicDict)Ryan Scott2021-04-2925-135/+437
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a more precise type signature to `magicDict` as proposed in #16646. In addition, this replaces the constant-folding rule for `magicDict` in `GHC.Core.Opt.ConstantFold` with a special case in the desugarer in `GHC.HsToCore.Expr.dsHsWrapped`. I have also renamed `magicDict` to `withDict` in light of the discussion in https://mail.haskell.org/pipermail/ghc-devs/2021-April/019833.html. All of this has the following benefits: * `withDict` is now more type safe than before. Moreover, if a user applies `withDict` at an incorrect type, the special-casing in `dsHsWrapped` will now throw an error message indicating what the user did incorrectly. * `withDict` can now work with classes that have multiple type arguments, such as `Typeable @k a`. This means that `Data.Typeable.Internal.withTypeable` can now be implemented in terms of `withDict`. * Since the special-casing for `withDict` no longer needs to match on the structure of the expression passed as an argument to `withDict`, it no longer cares about the presence or absence of `Tick`s. In effect, this obsoletes the fix for #19667. The new `T16646` test case demonstrates the new version of `withDict` in action, both in terms of `base` functions defined in terms of `withDict` as well as in terms of functions from the `reflection` and `singletons` libraries. The `T16646Fail` test case demonstrates the error message that GHC throws when `withDict` is applied incorrectly. This fixes #16646. By adding more tests for `withDict`, this also fixes #19673 as a side effect.
* Add GhcMessage and ancillary typesAlfredo Di Napoli2021-04-2988-653/+1333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds GhcMessage and ancillary (PsMessage, TcRnMessage, ..) types. These types will be expanded to represent more errors generated by different subsystems within GHC. Right now, they are underused, but more will come in the glorious future. See https://gitlab.haskell.org/ghc/ghc/-/wikis/Errors-as-(structured)-values for a design overview. Along the way, lots of other things had to happen: * Adds Semigroup and Monoid instance for Bag * Fixes #19746 by parsing OPTIONS_GHC pragmas into Located Strings. See GHC.Parser.Header.toArgs (moved from GHC.Utils.Misc, where it didn't belong anyway). * Addresses (but does not completely fix) #19709, now reporting desugarer warnings and errors appropriately for TH splices. Not done: reporting type-checker warnings for TH splices. * Some small refactoring around Safe Haskell inference, in order to keep separate classes of messages separate. * Some small refactoring around initDsTc, in order to keep separate classes of messages separate. * Separate out the generation of messages (that is, the construction of the text block) from the wrapping of messages (that is, assigning a SrcSpan). This is more modular than the previous design, which mixed the two. Close #19746. This was a collaborative effort by Alfredo di Napoli and Richard Eisenberg, with a key assist on #19746 by Iavor Diatchki. Metric Increase: MultiLayerModules
* Fix inlining of division wrappersSylvain Henry2021-04-291-0/+18
|
* Make divModInt# branchlessSylvain Henry2021-04-292-24/+69
|
* Allow divInt#/modInt# to inline (#18067)Sylvain Henry2021-04-291-2/+2
|
* Refactor modInt# to make it branchlessSylvain Henry2021-04-291-7/+59
|
* Refactor divInt# to make it branchless (#18067, #19636)Sylvain Henry2021-04-291-9/+68
|
* 19079 DerivingVia: incorrectly accepts deriving via types with differing ↵Sasha Bogicevic2021-04-271-3/+5
| | | | runtime representations
* fix #19736Daniel Rogozin2021-04-276-6/+24
|
* Introduce -ddump-verbose-inliningsBen Gamari2021-04-274-6/+15
| | | | | | | | Previously -ddump-inlinings and -dverbose-core2core used in conjunction would have the side-effect of dumping additional information about all inlinings considered by the simplifier. However, I have sometimes wanted this inlining information without the firehose of information produced by -dverbose-core2core. Introduce a new dump flag for this purpose.