| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
on re-setting it
|
| |
|
|
|
|
| |
unfolding
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So that we can inline their specialisation at call sites. Consider
```hs
-- This is the situation arising for concatMap in stream-fusion
r3 :: Int -> Int
r3 n = go1 0 1
where
go1 z i
| i > n = z
| otherwise = go2 z (i+1) next True
where
next True = Just (i*i, False)
next False = Nothing
go2 z i next s = case next s of
Nothing -> go1 z i
Just (x, s') -> go2 (z+x) i next s'
```
`go2` has static args and we want to specialise it for its call site in `go1`.
If we make `go2` the sole loop-breaker, that will never happen. But if we put
`go2` before `go1` (by picking `go1` as a loop-breaker instead), we can inline
it.
Unfortunately, picking `go1` as loop-breaker above still means that we pick `go2`
as loop-breaekr, so that it breaks its own loop. So both bindings are marked
as loop-breakers, but `go2` comes first.
I found that we still won't call site inline `go2`, because its discounts were
not enough. So I thought about modifying its occ info until we give it `Once`
occ. But that was very hacky and not working. I found that I could remove `go2`
from its own `inl_fvs`, but that also was not working, because it merely turns
`go2` from a strong into a weak loop-breaker (which on the bright side we may
inline, but that check is in `idUnfolding` which we override for static args
anyway). Just committing these attempts for future referecne. Will try to
delete what I did in the next commit.
Ultimately, the simplest way to call site inline is a huge hack for now: In
`tryUnfolding` we aggressively inline when the function has a static argument.
Fix that later.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
.. so that we can exploit it in the Simplifier.
|
|
|
|
| |
To adapt haddock for the nullary tyconapp optimisation patch.
|
| |
|
|
|
|
| |
Updates haddock submodule to revert a commit that does not build.
|
|
|
|
|
|
| |
This was inadvertently merged.
This reverts commit 6c2eb2232b39ff4720fda0a4a009fb6afbc9dcea.
|
|
|
| |
Due to #18548.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements the BoxedRep proposal, refacoring the `RuntimeRep`
hierarchy from:
```haskell
data RuntimeRep = LiftedPtrRep | UnliftedPtrRep | ...
```
to
```haskell
data RuntimeRep = BoxedRep Levity | ...
data Levity = Lifted | Unlifted
```
Closes #17526.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During the compilation of programs GHC very frequently deals with
the `Type` type, which is a synonym of `TYPE 'LiftedRep`. This patch
teaches GHC to avoid expanding the `Type` synonym (and other nullary
type synonyms) during type comparisons, saving a good amount of work.
This optimisation is described in `Note [Comparing nullary type
synonyms]`.
To maximize the impact of this optimisation, we introduce a few
special-cases to reduce `TYPE 'LiftedRep` to `Type`. See
`Note [Prefer Type over TYPE 'LiftedPtrRep]`.
Closes #17958.
Metric Decrease:
T18698b
T1969
T12227
T12545
T12707
T14683
T3064
T5631
T5642
T9020
T9630
T9872a
T13035
haddock.Cabal
haddock.base
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The naive way of putting out n characters of indent would be something
like `hPutStr hdl (replicate n ' ')`. However this is quite inefficient
as we allocate an absurd number of strings consisting of simply spaces
as we don't cache them.
To improve on this we now track if we can simply write ascii spaces via
hPutBuf instead. This is the case when running with -ddump-to-file where
we force the encoding to be UTF8.
This avoids both the cost of going through encoding as well as avoiding
allocation churn from all the white space. Instead we simply use hPutBuf
on a preallocated unlifted string.
When dumping stg like this:
> nofib/spectral/simple/Main.hs -fforce-recomp -ddump-stg-final -ddump-to-file -c +RTS -s
Allocations went from 1,778 MB to 1,702MB. About a 4% reduction of
allocation! I did not measure the difference in runtime but expect it
to be similar.
Bumps the haddock submodule since the interface of GHC's Pretty
slightly changed.
-------------------------
Metric Decrease:
T12227
-------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The unit database cache, the home unit and the unit state were stored in
DynFlags while they ought to be stored in the compiler session state
(HscEnv). This patch fixes this.
It introduces a new UnitEnv type that should be used in the future to
handle separate unit environments (especially host vs target units).
Related to #17957
Bump haddock submodule
|
|
|
|
|
|
| |
This was inadvertently merged.
This reverts commit 7e9debd4ceb068effe8ac81892d2cabcb8f55850.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
During the compilation of programs GHC very frequently deals with
the `Type` type, which is a synonym of `TYPE 'LiftedRep`. This patch
teaches GHC to avoid expanding the `Type` synonym (and other nullary
type synonyms) during type comparisons, saving a good amount of work.
This optimisation is described in `Note [Comparing nullary type
synonyms]`.
To maximize the impact of this optimisation, we introduce a few
special-cases to reduce `TYPE 'LiftedRep` to `Type`. See
`Note [Prefer Type over TYPE 'LiftedPtrRep]`.
Closes #17958.
Metric Decrease:
T18698b
T1969
T12227
T12545
T12707
T14683
T3064
T5631
T5642
T9020
T9630
T9872a
T13035
haddock.Cabal
haddock.base
|
|
|
|
|
| |
The haddock submodule is also updated so that it understands the changes
to patterns.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Both sub-demands encode the same information.
This is a trivial change and already affects a few regression tests
(e.g. `T5075`), so no separate regression test is necessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's useful to annotate a non-exported top-level function like `g` in
```hs
module Lib (h) where
g :: Int -> Int -> (Int,Int)
g m 1 = (m, 0)
g m n = (2 * m, 2 `div` n)
{-# NOINLINE g #-}
h :: Int -> Int
h 1 = 0
h m
| odd m = snd (g m 2)
| otherwise = uncurry (+) (g 2 m)
```
with its demand `UCU(CS(P(1P(U),SP(U))`, which tells us that whenever `g` was
called, the second component of the returned pair was evaluated strictly.
Since #18903 we do so for local functions, where we can see all calls.
For top-level functions, we can assume that all *exported* functions are
demanded according to `topDmd` and thus get sound demands for
non-exported top-level functions.
The demand on `g` is crucial information for Nested CPR, which may the
go on and unbox `g` for the second pair component. That is true even if
that pair component may diverge, as is the case for the call site `g 13
0`, which throws a div-by-zero exception.
In `T18894b`, you can even see the new demand annotation enabling us to
eta-expand a function that we wouldn't be able to eta-expand without
Call Arity.
We only track bindings of function type in order not to risk huge compile-time
regressions, see `isInterestingTopLevelFn`.
There was a CoreLint check that rejected strict demand annotations on
recursive or top-level bindings, which seems completely unjustified.
All the cases I investigated were fine, so I removed it.
Fixes #18894.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Move code unrelated to runtime evaluation out of GHC.Runtime.Eval
|
|
|
|
|
|
| |
Fix parsing of "libffi-3.3.tar.gz".
NB: switch to a newer libffi isn't done in this patch
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider the following code:
proc (C x y) -> ...
Before this patch, the evidence binding for the Arrow dictionary was
attached to the C pattern:
proc (C x y) { $dArrow = ... } -> ...
But then when we desugar this, we use arrow operations ("arr", ">>>"...)
specialised for this arrow:
let
arr_xy = arr $dArrow -- <-- Not in scope!
...
in
arr_xy (\(C x y) { $dArrow = ... } -> ...)
This patch allows arrow operations to be type-checked before the proc
itself, avoiding this issue.
Fix #17423
|
|
|
|
|
|
|
|
|
|
|
| |
This Note has severely bitrotted, as it has no references anywhere in the
codebase, and none of the functions that it mentions exist anymore. Let's just
delete this. While I was in town, I deleted some outdated comments from
`checkFamPatBinders` of a similar caliber.
Fixes #19008.
[ci skip]
|
|
|
|
|
| |
Tests that the output of the `:doc` command is correct for duplicate
record fields defined using -XDuplicateRecordFields.
|
|
|
|
|
|
|
|
| |
Do not print `<has no documentation>` alongside a valid doc.
Additionally, if two matching symbols lack documentation then the
message will only be printed once. Hence, `<has no documentation>` will
be printed at most once and only if all matching symbols are lacking
docs.
|
| |
|
|
|
|
|
| |
It looks like I neglected to update this after introduce flavour
transformers.
|
|
|
|
| |
Also refactor the job definition to eliminate the bug by construction.
|
|
|
|
|
|
| |
Every time I am asked about how to interpret these events I need to
figure it out from scratch. It's well past time that the users guide
properly documents these.
|
|
|
|
| |
Fixes errors introduced by 3a55b3a2574f913d046f3a6f82db48d7f6df32e3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The change fixes build failure on musl:
```
rts/linker/Elf.c:2031:3: error:
warning: implicit declaration of function 'dlclose'; did you mean 'close'? [-Wimplicit-function-declaration]
2031 | dlclose(nc->dlopen_handle);
| ^~~~~~~
| close
```
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
|
|
|
|
| |
Be more clear on what this optimisation being on by default means
in terms of yields.
|
|
|
|
|
|
| |
“Yield points enabled” is confusing (and probably wrong?
I am not 100% sure what it means). Change it to a simple “on”.
Undo this change from 2c23fff2e03e77187dc4d01f325f5f43a0e7cad2.
|
|
|
|
| |
This should fix #19002.
|