| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
This is a follow up from !2418 / #19579
[skip ci]
|
|
|
|
|
| |
All the comments are now captured in the AST, there is no need for a
side-channel structure for them.
|
|
|
|
|
| |
This commit adds the `lint:compiler` Hadrian target to the CI runner.
It does also fixes hints in the compiler/ and libraries/base/ codebases.
|
|
|
|
|
|
|
|
|
|
| |
The binder-swap transformation needs to be iterated, as shown
by #19581. The fix is pretty simple, and is explained in
point (BS2) of Note [The binder-swap substitution].
Net effect:
- sometimes, fewer simplifier iterations
- sometimes, more case merging
|
|
|
|
|
|
|
|
| |
It's used by all passes and already used as a regular field.
So I figured it would be both more consistent and performant
to make it a regular field for all constructors.
I also added a few bangs in the process.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-------------------------
Metric Decrease:
T783
T4801
T12707
T13379
T3294
T4801
T5321FD
-------------------------
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loader state was stored into HscEnv. As we need to have two
interpreters and one loader state per interpreter in #14335, it's
natural to make the loader state a field of the Interp type.
As a side effect, many functions now only require a Interp parameter
instead of HscEnv. Sadly we can't fully free GHC.Linker.Loader of HscEnv
yet because the loader is initialised lazily from the HscEnv the first
time it is used. This is left as future work.
HscEnv may not contain an Interp value (i.e. hsc_interp :: Maybe Interp).
So a side effect of the previous side effect is that callers of the
modified functions now have to provide an Interp. It is satisfying as it
pushes upstream the handling of the case where HscEnv doesn't contain an
Interpreter. It is better than raising a panic (less partial functions,
"parse, don't validate", etc.).
|
|
|
|
|
|
|
|
| |
In commit 540fa6b2 integer to float conversions were changed to round to
the nearest even. Implement a special case for 64 bit integer to single
precision floating point numbers.
Fixes #19563.
|
|
|
|
|
|
|
|
|
|
| |
Part of #18202
-------------------------
Metric Decrease:
T12707
T3294
-------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This Note says it all:
Note [Skip type holes rapidly]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose we have module with a /lot/ of partial type signatures, and we
compile it while suppressing partial-type-signature warnings. Then
we don't want to spend ages constructing error messages and lists of
relevant bindings that we never display! This happened in #14766, in
which partial type signatures in a Happy-generated parser cause a huge
increase in compile time.
The function ignoreThisHole short-circuits the error/warning generation
machinery, in cases where it is definitely going to be a no-op.
It makes a pretty big difference on the Sigs.hs example in #14766:
Compile-time allocation
GHC 8.10 5.6G
Before this patch 937G
With this patch 4.7G
Yes, that's more than two orders of magnitude!
|
|
|
|
|
| |
As noted in #19540, a number of users within and outside of GHC rely on
unsafeCoerceUnlifted to work around the fact that this was missing
|
|
|
|
|
|
|
|
|
|
|
| |
The `extendTyVarEnvFVRn` function does the exact same thing as
`bindLocalNamesFV`. I see no meaningful distinction between the two functions,
so let's just remove the former (which is only used in a handful of places) in
favor of the latter.
Historical note: `extendTyVarEnvFVRn` and `bindLocalNamesFV` used to be
distinct functions, but their implementations were synchronized in 2004 as a
part of commit 20e39e0e07e4a8e9395894b2785d6675e4e3e3b3.
|
|
|
|
|
|
|
| |
This requires bumping the `exceptions` and `text` submodules to bring in
commits that bump their respective upper version bounds on `template-haskell`.
Fixes #19083.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All credit to @hsyl20, who in
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4717#note_338560
figured out this was a problem.
To fix this, we use casts in addition to the shrinking and suffixing
that is already done. It might make for more verbose code, I don't think
that matters too much.
In the future, perhaps some of the shrinking and suffixing can be
removed for being redundant. That proved less trivial than it sounds, so
this wasn't done at this time.
Progress towards #19026
Metric Increase:
T12707
T13379
Co-authored-by: Sylvain Henry <hsyl20@gmail.com>
|
|
|
|
|
|
|
|
| |
As #19522 points out, we did not account for visible type
application when trying to reject naked levity-polymorphic
functions that have no binding.
This patch tidies up the code, and fixes the bug too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While fixing #19232, it became increasingly clear that the vestigial
hack described in `Note [Optimistic field binder CPR]` is complicated
and causes reboxing. Rather than make the hack worse, this patch
gets rid of it completely in favor of giving deeply unboxed parameters
the Nested CPR property. Example:
```hs
f :: (Int, Int) -> Int
f p = case p of
(x, y) | x == y = x
| otherwise = y
```
Based on `p`'s `idDemandInfo` `1P(1P(L),1P(L))`, we can see that both
fields of `p` will be available unboxed. As a result, we give `p` the
nested CPR property `1(1,1)`. When analysing the `case`, the field
CPRs are transferred to the binders `x` and `y`, respectively, so that
we ultimately give `f` the CPR property.
I took the liberty to do a bit of refactoring:
- I renamed `CprResult` ("Constructed product result result") to plain
`Cpr`.
- I Introduced `FlatConCpr` in addition to (now nested) `ConCpr` and
and according pattern synonym that rewrites flat `ConCpr` to
`FlatConCpr`s, purely for compiler perf reasons.
- Similarly for performance reasons, we now store binders with a
Top signature in a separate `IntSet`,
see `Note [Efficient Top sigs in SigEnv]`.
- I moved a bit of stuff around in `GHC.Core.Opt.WorkWrap.Utils` and
introduced `UnboxingDecision` to replace the `Maybe DataConPatContext`
type we used to return from `wantToUnbox`.
- Since the `Outputable Cpr` instance changed anyway, I removed the
leading `m` which we used to emit for `ConCpr`. It's just noise,
especially now that we may output nested CPRs.
Fixes #19398.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit reduces allocations by the simplifier by 3% for the
Cabal test at -O2.
We do this by making a few select fields, bindings and arguments strict
which reduces allocations for the simplifier by around 3% in total
for the Cabal test. Which is about 2% fewer allocations in total at
-O2.
-------------------------
Metric Decrease:
T18698a
T18698b
T9233
T9675
T9872a
T9872b
T9872c
T9872d
T10421
T12425
T13253
T5321FD
T9961
-------------------------
|
|
|
|
|
|
| |
tuples and sums.
fixes #1257
|
|
|
|
|
| |
Metric Increase:
MultiLayerModules
|
| |
|
|
|
|
|
| |
The 'id' type is now determined by the pass, using the XTickishId
type family.
|
|
|
|
|
|
|
|
| |
GHCi needs to know the types of all breakpoints, but it's
not possible to get the exprType of any expression in STG.
This is preparation for the upcoming change to make GHCi
bytecode from STG instead of Core.
|
|
|
|
|
|
|
|
| |
Metric Increase:
T10370
parsing001
Updates haddock submodule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MR introducing the API Annotations, !2418 is huge.
Conceptually it is two parts, the one deals with introducing the new
types to be used for annotations, and outlining how they will be
used. This is a small change, localised to
compiler/GHC/Parser/Annotation.hs and is contained in this commit.
The follow-up, larger commit deals with mechanically working this
through the entire AST and updating all the parts affected by it.
It is being split so the part that needs good review feedback can be
seen in isolation, prior to the rest coming in.
|
|
|
|
|
| |
Co-authored-by: Daniel Rogozin <daniel.rogozin@serokell.io>
Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io>
|
| |
|
|
|
|
|
|
| |
CmmToAsm.Reg.Linear: More strictness
More strictness
|
|
|
|
| |
Avoid top-level recursion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In #19194 mpickering detailed that there are a LOT of allocations
of IfaceTyConInfo:
There are just two main cases: IfaceTyConInfo IsPromoted IfaceNormalTyCon
and IfaceTyConInfo NotPromoted IfaceNormalTyCon. These should be made into
CAFs and shared. From my analysis, the most common case is
IfaceTyConInfo NotPromoted IfaceNormalTyCon (53 000)
then IfaceTyConInfo IsPromoted IfaceNormalTyCon (28 000).
This patch makes it so these are properly shared by using a smart
constructor.
Fixes #19194.
|
|
|
|
|
|
|
|
| |
When we use `withTiming` we need to force the results of each timed pass
to better represent the time spent in each phase. This patch forces
some results that weren't before.
It also retrieve timings for the CoreToStg and WriteIface passes.
|
|
|
|
|
|
|
| |
Previously we would support only one LLVM major version. Here we
generalize this to accept a range, taking this range to be LLVM 10 to 11,
as 11 is necessary for Apple M1 support. We also accept 12, as that is
what apple ships with BigSur on the M1.
|
|
|
|
|
|
|
|
| |
integerToFloat# and integerToDouble# were moved from ghc-bignum to base.
GHC.Integer.floatFromInteger and doubleFromInteger were removed.
Fixes #15926, #17231, #17782
|
|
|
|
|
| |
By moving the handling of TIGHT_INFIX_PROJ to the correct place,
we can remove the isGetField hack and fix a bug at the same time.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes `guessConLikeUnivTyArgsFromResTy` consider required
Thetas of PatSynCons, by treating them as Wanted constraints to be
discharged with the constraints from the Nabla's TyState and saying
"does not match the match type" if the Wanted constraints are unsoluble.
It calls out into a new function `GHC.Tc.Solver.tcCheckWanteds` to do
so.
In pushing the failure logic around call sites of `initTcDsForSolver`
inside it by panicking, I realised that there was a bunch of dead code
surrounding `pmTopMoraliseType`: I was successfully able to delete the
`NoChange` data constructor of `TopNormaliseTypeResult`.
The details are in `Note [Matching against a ConLike result type]` and
`Note [Instantiating a ConLike].
The regression test is in `T19475`. It's pretty much a fork of `T14422`
at the moment.
Co-authored-by: Cale Gibbard <cgibbard@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC Proposal: 0265-unlifted-datatypes.rst
Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265
Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523
Implementation Details: Note [Implementation of UnliftedDatatypes]
This patch introduces the `UnliftedDatatypes` extension. When this extension is
enabled, GHC relaxes the restrictions around what result kinds are allowed in
data declarations. This allows data types for which an unlifted or
levity-polymorphic result kind is inferred.
The most significant changes are in `GHC.Tc.TyCl`, where
`Note [Implementation of UnliftedDatatypes]` describes the details of the
implementation.
Fixes #19523.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement new debugger command `:ignore` to set an `ignore count`
for a specified breakpoint.
* Allow new optional parameter on `:continue` command to set an
`ignore count` for the current breakpoint.
* In the Interpreter replace the current `Word8` BreakArray with
an `Int` array.
* Change semantics of values in `BreakArray` to:
n < 0 : Breakpoint is disabled.
n == 0 : Breakpoint is enabled.
n > 0 : Breakpoint is enabled, but ignore next `n` iterations.
* Rewrite `:enable`/`:disable` processing as a special case of `:ignore`.
* Remove references to `BreakArray` from `ghc/UI.hs`.
|
| |
|
|
|
|
|
|
| |
This adds support for -XGHC2021, as described in Proposal 0380 [1].
[1] https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds two new methods to the Quasi class, putDoc and getDoc. They
allow Haddock documentation to be added to declarations, module headers,
function arguments and class/type family instances, as well as looked
up.
It works by building up a map of names to attach pieces of
documentation to, which are then added in the extractDocs function in
GHC.HsToCore.Docs. However because these template haskell names need to
be resolved to GHC names at the time they are added, putDoc cannot
directly add documentation to declarations that are currently being
spliced. To remedy this, withDecDoc/withDecsDoc wraps the operation with
addModFinalizer, and provides a more ergonomic interface for doing so.
Similarly, the funD_doc, dataD_doc etc. combinators provide a more
ergonomic interface for documenting functions and their arguments
simultaneously.
This also changes ArgDocMap to use an IntMap rather than an Map Int, for
efficiency.
Part of the work towards #5467
|
| |
|
|
|
|
| |
This saves at least one I# allocation per FastString.
|
|
|
|
| |
This will be needed by FastString.
|
|
|
|
| |
Updates haddock submodule.
|
|
|
|
| |
This appears to be unused.
|
|
|
|
|
|
|
| |
Previously, defining fields with DuplicateRecordFields in GHCi lead to
strange shadowing behaviour, whereby fields would (accidentally) not
shadow other fields. This simplifies things so that fields are shadowed
in the same way whether or not DuplicateRecordFields is enabled.
|
| |
|