Commits on Source (71)
-
Per the new `Note [Linting linearity]`, we want optimisations over trying to preserve linearity. This will allow CPR to handle `Ur`, in particular.
981e5e11 -
Per the new `Note [Linting linearity]`, we want optimisations over trying to preserve linearity. This will avoid preventing inlinings and reductions and make linear programs more efficient.
bf9344d2 -
This commit splits up the zonker into a few separate components, described in Note [The structure of the zonker] in `GHC.Tc.Zonk.Type`. 1. `GHC.Tc.Zonk.Monad` introduces a pared-down `TcM` monad, `ZonkM`, which has enough information for zonking types. This allows us to refactor `ErrCtxt` to use `ZonkM` instead of `TcM`, which guarantees we don't throw an error while reporting an error. 2. `GHC.Tc.Zonk.Env` is the new home of `ZonkEnv`, and also defines two zonking monad transformers, `ZonkT` and `ZonkBndrT`. `ZonkT` is a reader monad transformer over `ZonkEnv`. `ZonkBndrT m` is the codensity monad over `ZonkT m`. `ZonkBndrT` is used for computations that accumulate binders in the `ZonkEnv`. 3. `GHC.Tc.Zonk.TcType` contains the code for zonking types, for use in the typechecker. It uses the `ZonkM` monad. 4. `GHC.Tc.Zonk.Type` contains the code for final zonking to `Type`, which has been refactored to use `ZonkTcM = ZonkT TcM` and `ZonkBndrTcM = ZonkBndrT TcM`. Allocations slightly decrease on the whole due to using continuation-passing style instead of manual state passing of ZonkEnv in the final zonking to Type. ------------------------- Metric Decrease: T4029 T8095 T14766 T15304 hard_hole_fits RecordUpdPerf Metric Increase: T10421 -------------------------
f62d8195 -
Reference ticket #21766 This commit restructures IPE buffer list entries to not contain references to their corresponding info tables. IPE buffer list nodes now point to two lists of equal length, one holding the list of info table pointers and one holding the corresponding entries for each info table. This will allow the entry data to be compressed without losing the references to the info tables.
f3556d6c -
Reference ticket #21766 Adds an `--enable-ipe-data-compreesion` flag to the configure script which will check for libzstd and set the appropriate flags to allow for IPE data compression in the compiler
5d1f2411 -
Reference ticket #21766 When IPE data compression is enabled, compress the emitted IPE buffer entries and decompress them in the RTS.
b7a640ac -
Ensure that `HAVE_LIBZSTD` gets defined to either 0 or 1 in all cases and properly check that before IPE data decompression in the RTS. See ticket #21766.
5aef5658 -
See ticket #21766
69563c97 -
Make sure byte order of written IPE buffer entries matches target. Make sure the IPE-related tests properly access the fields of IPE buffer entry nodes with the new IPE layout. This commit also introduces checks to avoid importing modules if IPE compression is not enabled. See ticket #21766.
7872e2b6 -
Capacity of buffers allocated for decompressed IPE data was incorrect due to a misuse of the `ZSTD_findFrameCompressedSize` function. Fix by always storing decompressed size of IPE data in IPE buffer list nodes and using `ZSTD_findFrameCompressedSize` to determine the size of the compressed data. See ticket #21766
0e85099b -
Changes the configure script to indicate whether libnuma, libzstd, or libdw are being used as dependencies due to their optional features being enabled.
a0048866 -
- Adds an IPE job to the CI pipeline which is triggered by the ~IPE label - Introduces CI logic to enable IPE data compression - Enables uncompressed IPE data on debug CI job - Regenerates jobs.yaml MR ci-images!112 on the images repository is meant to ensure that the proper images have libzstd-dev installed.
09d93bd0 -
Add mention of IPE data compression to user's guide and the release notes for 9.8.1. Also note the impact compression has on binary size in both places. Change IpeBufferListNode compression check so only the value `1` indicates compression. See ticket #21766
3ded9a1c -
We don't need to explicitly specify the +ipe transformer to test IPE data since there are tests which manually enable IPE information. This commit does leave zstd IPE data compression enabled on the debian CI jobs.
41b41577 -
GHC.Tc.Zonk.Type uses an equality constraint. ghc.nix currently provides 9.2.
982bef3a -
This refactors the panoply of renamer lookup functions relating to lookupExactOrOrig to more graciously handle Exact and Orig names. In particular, we avoid the situation in which we would add Exact/Orig GREs to the tcg_used_gres field, which could cause a panic in bestImport like in #23240. Fixes #23428
8e81f140 -
As described in Note [The one-shot state monad trick], we shouldn't use derived Functor instances for monads using one-shot. This was done for most of them, but UM and RewriteM were missed.
5d415bfd -
setTestOpts() is used to modify the test options for an entire .T file, rather than a single test. If there was a test using collect_compiler_stats, all of the tests in the same file had lint disabled. Fixes #21247
2c38551e -
It is no longer needed since Note [Extra dependencies from .hs-boot files] was deleted in 69987720. I've also added tildes to Note headers, otherwise they're not detected by the linter.
f6e060cc -
For reasons similar to those described in Note [Depend on GHC.Num.Integer]. Fixes #23411.
4a4eb761 -
Flag -ddisable-js-minimizer was producing invalid code. Fix that and also a few other things to generate nicer JS code for debugging. The added test checks that we don't regress when using the flag.
f53ac0ae -
f7744e8e
-
Matthew Pickering authored
The overall goal of this refactoring is to reduce the dependency footprint of the parser and syntax tree. Good reasons include: - Better module graph parallelisability - Make it easier to migrate error messages without introducing module loops - Philosophically, there's not reason for the AST to depend on half the compiler. One of the key edges which added this dependency was > GHC.Hs.Expr -> GHC.Tc.Types (TcLclEnv) As this in turn depending on TcM which depends on HscEnv and so on. Therefore the goal of this patch is to move `TcLclEnv` out of `GHC.Tc.Types` so that `GHC.Hs.Expr` can import TcLclEnv without incurring a huge dependency chain. The changes in this patch are: * Move TcLclEnv from GHC.Tc.Types to GHC.Tc.Types.LclEnv * Create new smaller modules for the types used in TcLclEnv New Modules: - GHC.Tc.Types.ErrCtxt - GHC.Tc.Types.BasicTypes - GHC.Tc.Types.TH - GHC.Tc.Types.LclEnv - GHC.Tc.Types.CtLocEnv - GHC.Tc.Errors.Types.PromotionErr Removed Boot File: - {-# SOURCE #-} GHC.Tc.Types * Introduce TcLclCtxt, the part of the TcLclEnv which doesn't participate in restoreLclEnv. * Replace TcLclEnv in CtLoc with specific CtLocEnv which is defined in GHC.Tc.Types.CtLocEnv. Use CtLocEnv in Implic and CtLoc to record the location of the implication and constraint. By splitting up TcLclEnv from GHC.Tc.Types we allow GHC.Hs.Expr to no longer depend on the TcM monad and all that entails. Fixes #23389 #23409
7cd8a61e -
Matthew Pickering authored
This removes the usage of DynFlags from Tc.Utils.TcType so that it no longer depends on GHC.Driver.Session. In general we don't want anything which is a dependency of Language.Haskell.Syntax to depend on GHC.Driver.Session and removing this edge gets us closer to that goal.
3d8d39d1 -
Matthew Pickering authored
This removes edge from GHC.Hs.Pat to GHC.Driver.Session, which makes Language.Haskell.Syntax end up depending on GHC.Driver.Session.
18db5ada -
Matthew Pickering authored12919dd5
-
Matthew Pickering authored
The hole fit plugins are defined in terms of TcM, a type we want to avoid depending on from `GHC.Tc.Errors.Types`. By moving it into its own module we can remove this dependency. It also simplifies the necessary boot file.
eb852371 -
Matthew Pickering authored
This allows `GHC.Driver.DynFlags` to depend on these types without depending on CoreM and hence the entire simplifier pipeline. We can also remove a hs-boot file with this change.
9e5246d7 -
Matthew Pickering authored52d6a7d7
-
Matthew Pickering authored
These are in a separate commit as the improvement to these tests is the cumulative effect of the previous set of patches rather than just the responsibility of the last one in the patchset.
698d160c -
The VarBind constructor of HsBind is only used at the GhcTc stage. This commit makes that explicit by setting the extension field of VarBind to be DataConCantHappen at all other stages. This allows us to delete a dead code path in GHC.HsToCore.Quote.rep_bind, and remove some panics.
58ccf02e -
The existing utils/genprimopcode/gen_bytearray_ops.py was relocated and extended for this purpose. Additionally, hadrian now knows about this script and uses it when generating primops.txt
54b83253 -
Previously we were always adding the Nightly tag, but this led to all the previous builds getting an increasing number of nightly tags over time. Now we just add it once, when we remove the LatestNightly tag.
ecadbc7e -
Vladislav Zavialov authored
This patch implements @k-binders introduced in GHC Proposal #425 and guarded behind the TypeAbstractions extension: type D :: forall k j. k -> j -> Type data D @k @j a b = ... ^^ ^^ To represent the new syntax, we modify LHsQTyVars as follows: - hsq_explicit :: [LHsTyVarBndr () pass] + hsq_explicit :: [LHsTyVarBndr (HsBndrVis pass) pass] HsBndrVis is a new data type that records the distinction between type variable binders written with and without the @ sign: data HsBndrVis pass = HsBndrRequired | HsBndrInvisible (LHsToken "@" pass) The rest of the patch updates GHC, template-haskell, and haddock to handle the new syntax. Parser: The PsErrUnexpectedTypeAppInDecl error message is removed. The syntax it used to reject is now permitted. Renamer: The @ sign does not affect the scope of a binder, so the changes to the renamer are minimal. See rnLHsTyVarBndrVisFlag. Type checker: There are three code paths that were updated to deal with the newly introduced invisible type variable binders: 1. checking SAKS: see kcCheckDeclHeader_sig, matchUpSigWithDecl 2. checking CUSK: see kcCheckDeclHeader_cusk 3. inference: see kcInferDeclHeader, rejectInvisibleBinders Helper functions bindExplicitTKBndrs_Q_Skol and bindExplicitTKBndrs_Q_Tv are generalized to work with HsBndrVis. Updates the haddock submodule. Metric Increase: MultiLayerModulesTH_OneShot Co-authored-by:
Simon Peyton Jones <simon.peytonjones@gmail.com>
4aea0a72 -
b7600997
-
e5d3940d
-
This reverts commit 41b41577.
960ef111 -
This reverts commit 3ded9a1c.
bad1c8cc -
This reverts commit 09d93bd0.
12726d90 -
This reverts commit a0048866.
dbdd989d -
This reverts commit 0e85099b.
240483af -
This reverts commit 7872e2b6.
9b8c7dd8 -
This reverts commit 69563c97.
3364379b -
This reverts commit 5aef5658.
fda30670 -
This reverts commit b7a640ac.
1cbcda9a -
This reverts commit 5d1f2411.
fb5e99aa -
This reverts commit f3556d6c.
2cdcb3a5 -
Simon Peyton Jones authored
This fixes #23323 See (RC4) in Note [Tracking redundant constraints]
2b0c9f5e -
567b32e1
-
This partially reverts some of the changes in !9475 to make `base` and `ghc-prim` depend on the `mingwex` library on Windows. It also restores the RTS's stubs for `mingwex`-specific symbols such as `_lock_file`. This is done because the C runtime provides `libmingwex` nowadays, and moreoever, not linking against `mingwex` requires downstream users to link against it explicitly in difficult-to-predict circumstances. Better to always link against `mingwex` and prevent users from having to do the guesswork themselves. See !10360 (comment 495873) for the discussion that led to this.
2b1a4abe -
We were checking that TH-spliced data declarations do not look like this: ```hs data D :: Type = MkD Int ``` But we were only doing so for `data` declarations' data constructors, not for `newtype`s, `data instance`s, or `newtype instance`s. This patch factors out the necessary validity checks into its own `cvtDataDefnCons` function and uses it in all of the places where it needs to be. Fixes #22559.
3ab0155b -
This fixes the behaviour of -keep-tmp-files when used in an OPTIONS_GHC pragma for files with module level scope. Instead of simple not deleting the files, we also need to remove them from the TmpFs so they are not deleted later on when all the other files are deleted. There are additional complications because you also need to remove the directory where these files live from the TmpFs so we don't try to delete those later either. I added two tests. 1. Tests simply that -keep-tmp-files works at all with a single module and --make mode. 2. The other tests that temporary files are deleted for other modules which don't enable -keep-tmp-files. Fixes #23339
a24b83dd -
Ticket #23305 reports an error where we were attempting to use the logger which was created by withDeferredDiagnostics after its scope had ended. This problem would have been caught by this patch and a validate build: ``` +*** Exception: Use after free +CallStack (from HasCallStack): + error, called at compiler/GHC/Driver/Make.hs:<line>:<column> in <package-id>:GHC.Driver.Make ``` This general issue is tracked by #20981
dcf32882 -
By returning a complete HscEnv from upsweep the logger (as introduced by withDeferredDiagnostics) was escaping the scope of withDeferredDiagnostics and hence we were losing error messages. This is reminiscent of #20981, which also talks about writing errors into messages after their scope has ended. See #23305 for details.
432c736c -
Introduce a `-ddump-spec-constr` flag which debugs specialisations from `SpecConstr`. These are no longer shown when you use `-ddump-spec`.
26013cdc -
Ticket #23454 explained it was possible to implement unsafeCoerce because SNat was lacking a role annotation. As these are supposed to be singleton types but backed by an efficient representation the correct annotation is nominal to ensure these kinds of coerces are forbidden. These annotations were missed from https://github.com/haskell/core-libraries-committee/issues/85 which was implemented in 532de368. CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/170 Fixes #23454
4639100b -
This broke the sdist generation. Fixes #23489
9c0dcff7 -
273ff0c7
-
-Wterm-variable-capture wasn't accordant with type variable scoping in associated types, in type classes. For example, this code produced the warning: k = 12 class C k a where type AT a :: k -> Type I solved this issue by reusing machinery of newTyVarNameRn function that is accordand with associated types: it does lookup for each free type variable when we are in the type class context. And in this patch I use result of this work to make sure that -Wterm-variable-capture warns only on implicitly quantified type variables.
b84a2900 -
9d1a8d87
-
See `Note [Combine identical alternatives: Unfoldings]` for details. Fixes #20138.
46884ca9
Showing
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py 1 addition, 1 deletion.gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- CODEOWNERS 5 additions, 5 deletionsCODEOWNERS
- HACKING.md 4 additions, 36 deletionsHACKING.md
- compiler/GHC/Builtin/Names/TH.hs 28 additions, 3 deletionscompiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types/Prim.hs 5 additions, 0 deletionscompiler/GHC/Builtin/Types/Prim.hs
- compiler/GHC/Builtin/bytearray-ops.txt.pp 0 additions, 551 deletionscompiler/GHC/Builtin/bytearray-ops.txt.pp
- compiler/GHC/Builtin/gen_bytearray_addr_access_ops.py 201 additions, 0 deletionscompiler/GHC/Builtin/gen_bytearray_addr_access_ops.py
- compiler/GHC/Builtin/primops.txt.pp 2 additions, 228 deletionscompiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Core/Lint.hs 6 additions, 4 deletionscompiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs 2 additions, 12 deletionscompiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CallerCC.hs 1 addition, 94 deletionscompiler/GHC/Core/Opt/CallerCC.hs
- compiler/GHC/Core/Opt/CallerCC.hs-boot 0 additions, 8 deletionscompiler/GHC/Core/Opt/CallerCC.hs-boot
- compiler/GHC/Core/Opt/CallerCC/Types.hs 113 additions, 0 deletionscompiler/GHC/Core/Opt/CallerCC/Types.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs 1 addition, 1 deletioncompiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs 12 additions, 18 deletionscompiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/TyCon.hs 11 additions, 8 deletionscompiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs 46 additions, 45 deletionscompiler/GHC/Core/Type.hs
- compiler/GHC/Core/Unify.hs 4 additions, 1 deletioncompiler/GHC/Core/Unify.hs
- compiler/GHC/Core/Utils.hs 92 additions, 7 deletionscompiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs 3 additions, 3 deletionscompiler/GHC/CoreToStg/Prep.hs
compiler/GHC/Core/Opt/CallerCC/Types.hs
0 → 100644