| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Now since we no longer try to predict CAFfyness we have no need for the
solution to #16846. Eta expanding unsaturated primop applications is
conceptually simpler, especially in the presence of levity polymorphism.
This essentially reverts cac8dc9f51e31e4c0a6cd9bc302f7e1bc7c03beb,
as suggested in #18079.
Closes #18079.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Because runRW# inlines so late, we were previously able to do very
little simplification across it. For instance, given even a simple
program like
case runRW# (\s -> let n = I# 42# in n) of
I# n# -> f n#
we previously had no way to avoid the allocation of the I#.
This patch allows the simplifier to push strict contexts into the
continuation of a runRW# application, as explained in
in Note [Simplification of runRW#] in GHC.CoreToStg.Prep.
Fixes #15127.
Metric Increase:
T9961
Metric Decrease:
ManyConstructors
Co-Authored-By: Simon Peyton-Jone <simonpj@microsoft.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We hvae been making exprIsConApp_maybe cleverer in recent times:
commit b78cc64e923716ac0512c299f42d4d0012306c05
Date: Thu Nov 15 17:14:31 2018 +0100
Make constructor wrappers inline only during the final phase
commit 7833cf407d1f608bebb1d38bb99d3035d8d735e6
Date: Thu Jan 24 17:58:50 2019 +0100
Look through newtype wrappers (Trac #16254)
commit c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1
Date: Thu Feb 21 12:03:22 2019 +0000
Fix exprIsConApp_maybe
But alas there was still a bug, now immortalised in
Note [Don't float join points]
in SimpleOpt.
It's quite hard to trigger because it requires a dead
join point, but it came up when compiling Cabal
Cabal.Distribution.Fields.Lexer.hs, when working on
!3113.
Happily, the fix is extremly easy. Finding the
bug was not so easy.
|
|
|
|
|
|
|
|
|
| |
Consider
join x = rhs in body
It's important that the type of 'rhs' is the same as the type of
'body', but Lint wasn't checking that invariant.
Now it does! This was exposed by investigation into !3113.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An redundant constraint prevented the rule from matching.
Fixing this allows a call to elem on a known list to be translated
into a series of equality checks, and eventually a simple case
expression.
Surprisingly this seems to regress elem for strings. To avoid
this we now also allow foldrCString to inline and add an UTF8
variant. This results in elem being compiled to a tight
non-allocating loop over the primitive string literal which
performs a linear search.
In the process this commit adds UTF8 variants for some of the
functions in GHC.CString. This is required to make this work for
both ASCII and UTF8 strings.
There are also small tweaks to the CString related rules.
We now allow ourselfes the luxury to compare the folding function
via eqExpr, which helps to ensure the rule fires before we inline
foldrCString*. Together with a few changes to allow matching on both
the UTF8 and ASCII variants of the CString functions.
|
|
|
|
|
| |
As noted in #18232, this field is currently completely unused and
moreover doesn't have a clear meaning.
|
|
|
|
|
| |
Teach hadrian to ignore GHC's -v argument in its recompilation check,
thus fixing #18131.
|
|
|
|
|
| |
This makes it significantly easier to spot the nature of
allocations regressions and comes at a reasonably low cost.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider
```hs
m :: IO ()
m = do
putStrLn "foo"
error "bar"
```
`m` (from #18086) always throws a (precise or imprecise) exception or
diverges. Yet demand analysis infers `<L,A>` as demand signature instead
of `<L,A>x` for it.
That's because the demand analyser sees `putStrLn` occuring in a case
scrutinee and decides that it has to `deferAfterPreciseException`,
because `putStrLn` throws a precise exception on some control flow
paths. This will mask the `botDiv` `Divergence`of the single case alt
containing `error` to `topDiv`. Since `putStrLn` has `topDiv` itself,
the final `Divergence` is `topDiv`.
This is easily fixed: `deferAfterPreciseException` works by `lub`ing
with the demand type of a virtual case branch denoting the precise
exceptional control flow. We used `nopDmdType` before, but we can be
more precise and use `exnDmdType`, which is `nopDmdType` with `exnDiv`.
Now the `Divergence` from the case alt will degrade `botDiv` to `exnDiv`
instead of `topDiv`, which combines with the result from the scrutinee
to `exnDiv`, and all is well.
Fixes #18086.
|
|
|
|
|
|
|
|
| |
Otherwise we risk turning trivial RHS into non-trivial RHS, introducing
unnecessary bindings in the next Simplifier run, resulting in more
churn.
Fixes #18231.
|
|
|
|
|
|
|
|
| |
Run the core linter on candidate instances to ensure they are
well-kinded.
Better handle quantified constraints by using a CtWanted to avoid
having unsolved constraints thrown away at the end by the solver.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While ticky-profiling the typechecker I noticed that hundreds of
millions of SDocs are being allocated just in case -ddump-*-trace is
enabled. This is awful.
We avoid this by ensuring that the dump flag check is inlined into the
call site, ensuring that the tracing document needn't be allocated
unless it's actually needed.
See Note [INLINE conditional tracing utilities] for details.
Fixes #18168.
Metric Decrease:
T9961
haddock.Cabal
haddock.base
haddock.compiler
|
|
|
|
|
| |
This reduces duplication as well as fixes a bug wherein -dinlining-check
would override -ddump-inlinings. Moreover, the new variant
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Previously no attempt was made to avoid multiple threads writing their
capability-local eventlog buffers to the eventlog writer simultaneously.
This could result in multiple eventlog streams being interleaved. Fix
this by documenting that the EventLogWriter's write() and flush()
functions may be called reentrantly and fix the default writer to
protect its FILE* by a mutex.
Fixes #18210.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch updates file paths according to new module hierarchy [1]:
* GHC/Core.hs <= coreSyn/CoreSyn.hs
* GHC/Core/Coercion.hs <= types/Coercion.hs
* GHC/Core/Coercion/Axiom.hs <= types/CoAxiom.hs
* GHC/Core/Coercion/Opt.hs <= types/OptCoercion.hs
* GHC/Core/DataCon.hs <= basicTypes/DataCon.hs
* GHC/Core/FamInstEnv.hs <= types/FamInstEnv.hs
* GHC/Core/Lint.hs <= coreSyn/CoreLint.hs
* GHC/Core/Subst.hs <= coreSyn/CoreSubst.hs
* GHC/Core/TyCo/Rep.hs <= types/TyCoRep.hs
* GHC/Core/TyCon.hs <= types/TyCon.hs
* GHC/Core/Type.hs <= types/Type.hs
* GHC/Core/Unify.hs <= types/Unify.hs
* GHC/Types/Literal.hs <= basicTypes/Literal.hs
* GHC/Types/Var.hs <= basicTypes/Var.hs
[1]: https://gitlab.haskell.org/ghc/ghc/-/wikis/Make-GHC-codebase-more-modular
[skip ci]
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We should allow a wrapper with up to 82 parameters when the original
function had 82 parameters to begin with.
I verified that this made no difference on NoFib, but then again
it doesn't use huge records...
Fixes #18122.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See `testsuite/tests/hiefile/should_run/HieQueries.hs` and
`testsuite/tests/hiefile/should_run/HieQueries.stdout` for an example of this
We add two new fields, `EvidenceVarBind` and `EvidenceVarUse` to the
`ContextInfo` associated with an Identifier. These are associated with the
appropriate identifiers for the evidence variables collected when we come across
`HsWrappers`, `TcEvBinds` and `IPBinds` while traversing the AST.
Instance dictionary and superclass selector dictionaries from `tcg_insts` and
classes defined in `tcg_tcs` are also recorded in the AST as originating from
their definition span
This allows us to save a complete picture of the evidence constructed by the
constraint solver, and will let us report this to the user, enabling features
like going to the instance definition from the invocation of a class method(or
any other method taking a constraint) and finding all usages of a particular
instance.
Additionally,
- Mark NodeInfo with an origin so we can differentiate between bindings
origininating in the source vs those in ghc
- Along with typeclass evidence info, also include information on Implicit
Parameters
- Add a few utility functions to HieUtils in order to query the new info
Updates haddock submodule
|
| |
|
|
|
|
|
| |
emptyModBreaks contains a bottom and consequently it's important that we
don't use it unless necessary.
|
|
|
|
| |
This just seems like a good idea.
|
|
|
|
| |
This could otherwise easily cause a leak of (+) thunks.
|
|
|
|
|
|
|
|
| |
To determine whether the module is a boot module
Coverage.addTicksToBinds was checking for a `boot` suffix in the module
source filename. This is quite ad-hoc and shouldn't be necessary; the
callsite in `deSugar` already checks that the module isn't a boot
module.
|
|
|
|
|
|
|
|
| |
As noted in !3132, this has rather severe knock-on consequences in
user-code. We'll need to revisit this before merging something along
these lines.
This reverts commit 9749fe1223d182b1f8e7e4f7378df661c509f396.
|
|
|
|
|
|
|
| |
The tokens `[|`, `|]`, `(|`, and `|)` are opening/closing tokens as
described in GHC Proposal #229. This commit makes the unicode
variants (`⟦`, `⟧`, `⦇`, and `⦈`) act the same as their ASCII
counterparts.
|
|
|
|
| |
Fixed by @alp (see https://gitlab.haskell.org/ghc/ghc/issues/16051#note_274265)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`Ordering` needs to be wired in for use in the built-in `CmpNat` and
`CmpSymbol` type families, but somehow it was never added to the list
of `wiredInTyCons`, leading to the various oddities observed
in #18185. Easily fixed by moving `orderingTyCon` from
`basicKnownKeyNames` to `wiredInTyCons`.
Fixes #18185.
|
| |
|
|
|
|
| |
See discussion in https://gitlab.haskell.org/ghc/ghc/issues/13009#note_268610
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The immediate goal is let the hie-bios.bat script
set CABFLAGS with `-v0` and remove all cabal output
except the compiler arguments
|
|
|
|
| |
It is a direct translation of the sh script
|
|
|
|
|
|
|
| |
This can be used to tell git to ignore bulk renaming commits like the
recently-finished module hierarchy refactoring. Configured with,
git config blame.ignoreRevsFile .git-ignore-revs
|
|
|
|
| |
Fixes #18206.
|
|
|
|
| |
Fixes #17926.
|
|
|
|
|
|
|
|
|
|
|
|
| |
- `forAllOrNothing` now is monadic, so we can trace whether we bind
an explicit `forall` or not.
- #18145 arose because the free vars calculation was needlessly
complex. It is now greatly simplified.
- Replaced some other implicit var code with `filterFreeVarsToBind`.
Co-authored-by: Ryan Scott <ryan.gl.scott@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes #17619, where a tick snuck in to the template of a rule,
resulting in a panic during rule matching. The tick in question was
introduced via post-inlining, as discussed in `Note [Simplifying
rules]`. The solution we decided upon was to simply ignore ticks in the
rule template, as discussed in `Note [Tick annotations in RULE
matching]`.
Fixes #18162.
Fixes #17619.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function and its accompanying rule resolve issue #5218.
A future PR to the bytestring library will make the internal
Data.ByteString.Internal.unsafePackAddress compute string length
with cstringLength#. This will improve the status quo because it is
eligible for constant folding.
Additionally, introduce a new data constructor to ForeignPtrContents
named FinalPtr. This additional data constructor, when used in the
IsString instance for ByteString, leads to more Core-to-Core
optimization opportunities, fewer runtime allocations, and smaller
binaries.
Also, this commit re-exports all the functions from GHC.CString
(including cstringLength#) in GHC.Exts. It also adds a new test
driver. This test driver is used to perform substring matches on Core
that is dumped after all the simplifier passes. In this commit, it is
used to check that constant folding of cstringLength# works.
|
|
|
|
| |
[skip ci]
|
|
|
|
| |
It doesn't belong into GHC.Unit.State
|
|
|
|
|
|
| |
Previously, we sorted according to the test name and way,
but the metrics (max_bytes_used/peak_megabytes_allocated etc.)
were appearing in nondeterministic order.
|