[Git][ghc/ghc][wip/T18987] 88 commits: [Sized Cmm] properly retain sizes.

Simon Peyton Jones gitlab at gitlab.haskell.org
Mon Dec 14 16:09:26 UTC 2020



Simon Peyton Jones pushed to branch wip/T18987 at Glasgow Haskell Compiler / GHC


Commits:
be5d74ca by Moritz Angermann at 2020-11-26T16:00:32-05:00
[Sized Cmm] properly retain sizes.

This replaces all Word<N> = W<N># Word# and Int<N> = I<N># Int#  with
Word<N> = W<N># Word<N># and Int<N> = I<N># Int<N>#, thus providing us
with properly sized primitives in the codegenerator instead of pretending
they are all full machine words.

This came up when implementing darwinpcs for arm64.  The darwinpcs reqires
us to pack function argugments in excess of registers on the stack.  While
most procedure call standards (pcs) assume arguments are just passed in
8 byte slots; and thus the caller does not know the exact signature to make
the call, darwinpcs requires us to adhere to the prototype, and thus have
the correct sizes.  If we specify CInt in the FFI call, it should correspond
to the C int, and not just be Word sized, when it's only half the size.

This does change the expected output of T16402 but the new result is no
less correct as it eliminates the narrowing (instead of the `and` as was
previously done).

Bumps the array, bytestring, text, and binary submodules.

Co-Authored-By: Ben Gamari <ben at well-typed.com>

Metric Increase:
    T13701
    T14697

- - - - -
a84e53f9 by Andreas Klebinger at 2020-11-26T16:00:32-05:00
RTS: Fix failed inlining of copy_tag.

On windows using gcc-10 gcc failed to inline copy_tag into evacuate.

To fix this we now set the always_inline attribute for the various
copy* functions in Evac.c. The main motivation here is not the
overhead of the function call, but rather that this allows the code
to "specialize" for the size of the closure we copy which is often
known at compile time.

An earlier commit also tried to avoid evacuate_large inlining. But
didn't quite succeed. So I also marked evacuate_large as noinline.

Fixes #12416

- - - - -
cdbd16f5 by Sylvain Henry at 2020-11-26T16:00:33-05:00
Fix toArgRep to support 64-bit reps on all systems

[This is @Ericson2314 writing a commit message for @hsyl20's patch.]

(Progress towards #11953, #17377, #17375)

`Int64Rep` and `Word64Rep` are currently broken on 64-bit systems.  This
is because they should use "native arg rep" but instead use "large arg
rep" as they do on 32-bit systems, which is either a non-concept or a
128-bit rep depending on one's vantage point.

Now, these reps currently aren't used during 64-bit compilation, so the
brokenness isn't observed, but I don't think that constitutes reasons
not to fix it. Firstly, the linked issues there is a clearly expressed
desire to use explicit-bitwidth constructs in more places. Secondly, per
[1], there are other bugs that *do* manifest from not threading
explicit-bitwidth information all the way through the compilation
pipeline. One can therefore view this as one piece of the larger effort
to do that, improve ergnomics, and squash remaining bugs.

Also, this is needed for !3658. I could just merge this as part of that,
but I'm keen on merging fixes "as they are ready" so the fixes that
aren't ready are isolated and easier to debug.

[1]: https://mail.haskell.org/pipermail/ghc-devs/2020-October/019332.html

- - - - -
a9378e69 by Tim Barnes at 2020-11-26T16:00:34-05:00
Set dynamic users-guide TOC spacing (fixes #18554)

- - - - -
86a59d93 by Ben Gamari at 2020-11-26T16:00:34-05:00
rts: Use RTS_LIKELY in CHECK

Most compilers probably already infer that
`barf` diverges but it nevertheless doesn't
hurt to be explicit.
- - - - -
5757e82b by Matthew Pickering at 2020-11-26T16:00:35-05:00
Remove special case for GHC.ByteCode.Instr

This was added in
https://github.com/nomeata/ghc-heap-view/commit/34935206e51b9c86902481d84d2f368a6fd93423

GHC.ByteCode.Instr.BreakInfo no longer exists so the special case is dead code.

Any check like this can be easily dealt with in client code.

- - - - -
d9c8b5b4 by Matthew Pickering at 2020-11-26T16:00:35-05:00
Split Up getClosureDataFromHeapRep

Motivation

1. Don't enforce the repeated decoding of an info table, when the client
can cache it (ghc-debug)
2. Allow the constructor information decoding to be overridden, this
casues segfaults in ghc-debug

- - - - -
3e3555cc by Andreas Klebinger at 2020-11-26T16:00:35-05:00
RegAlloc: Add missing raPlatformfield to RegAllocStatsSpill

Fixes #18994

Co-Author: Benjamin Maurer <maurer.benjamin at gmail.com>

- - - - -
a1a75aa9 by Ben Gamari at 2020-11-27T06:20:41-05:00
rts: Allocate MBlocks with MAP_TOP_DOWN on Windows

As noted in #18991, we would previously allocate heap in low memory.
Due to this the linker, which typically *needs* low memory, would end up
competing with the heap. In longer builds we end up running out of
low memory entirely, leading to linking failures.

- - - - -
75fc1ed5 by Sylvain Henry at 2020-11-28T15:40:23-05:00
Hadrian: fix detection of ghc-pkg for cross-compilers

- - - - -
7cb5df96 by Sylvain Henry at 2020-11-28T15:40:23-05:00
hadrian: fix ghc-pkg uses (#17601)

Make sure ghc-pkg doesn't read the compiler "settings" file by passing
--no-user-package-db.

- - - - -
e3fd4226 by Ben Gamari at 2020-11-28T15:40:23-05:00
gitlab-ci: Introduce a nightly cross-compilation job

This adds a job to test cross-compilation from x86-64 to AArch64 with
Hadrian.

Fixes #18234

- - - - -
698d3d96 by Ben Gamari at 2020-11-28T15:41:00-05:00
gitlab-ci: Only deploy GitLab Pages in ghc/ghc>

The deployments are quite large and yet are currently only served for
the ghc/ghc> project.

- - - - -
625726f9 by David Eichmann at 2020-11-28T15:41:37-05:00
ghc-heap: partial TSO/STACK decoding

Co-authored-by: Sven Tennie <sven.tennie at gmail.com>
Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com>
Co-authored-by: Ben Gamari <bgamari.foss at gmail.com>

- - - - -
22ea9c29 by Andreas Klebinger at 2020-11-28T15:42:13-05:00
Small optimization to CmmSink.

Inside `regsUsedIn` we can avoid some thunks by specializing the
recursion. In particular we avoid the thunk for `(f e z)` in the
MachOp/Load branches, where we know this will evaluate to z.

Reduces allocations for T3294 by ~1%.

- - - - -
bba42c62 by John Ericson at 2020-11-28T15:42:49-05:00
Make primop handler indentation more consistent

- - - - -
c82bc8e9 by John Ericson at 2020-11-28T15:42:49-05:00
Cleanup some primop constructor names

Harmonize the internal (big sum type) names of the native vs fixed-sized
number primops a bit. (Mainly by renaming the former.)

No user-facing names are changed.

- - - - -
ae14f160 by Ben Gamari at 2020-11-28T15:43:25-05:00
testsuite: Mark T14702 as fragile on Windows

Due to #18953.

- - - - -
1bc104b0 by Ben Gamari at 2020-11-29T15:33:18-05:00
withTimings: Emit allocations counter

This will allow us to back out the allocations per compiler pass from
the eventlog. Note that we dump the allocation counter rather than the
difference since this will allow us to determine how much work is done
*between* `withTiming` blocks.

- - - - -
e992ea84 by GHC GitLab CI at 2020-11-29T15:33:54-05:00
ThreadPaused: Don't zero slop until free vars are pushed

When threadPaused blackholes a thunk it calls `OVERWRITING_CLOSURE` to
zero the slop for the benefit of the sanity checker. Previously this was
done *before* pushing the thunk's free variables to the update
remembered set. Consequently we would pull zero'd pointers to the update
remembered set.

- - - - -
e82cd140 by GHC GitLab CI at 2020-11-29T15:33:54-05:00
nonmoving: Fix regression from TSAN work

The TSAN rework (specifically aad1f803) introduced a subtle regression
in GC.c, swapping `g0` in place of `gen`. Whoops!

Fixes #18997.

- - - - -
35a5207e by GHC GitLab CI at 2020-11-29T15:33:54-05:00
rts/Messages: Add missing write barrier in THROWTO message update

After a THROWTO message has been handle the message closure is
overwritten by a NULL message. We must ensure that the original
closure's pointers continue to be visible to the nonmoving GC.

- - - - -
0120829f by GHC GitLab CI at 2020-11-29T15:33:54-05:00
nonmoving: Add missing write barrier in shrinkSmallByteArray

- - - - -
8a4d8fb6 by GHC GitLab CI at 2020-11-29T15:33:54-05:00
Updates: Don't zero slop until closure has been pushed

Ensure that the the free variables have been pushed to the update
remembered set before we zero the slop.

- - - - -
2793cfdc by GHC GitLab CI at 2020-11-29T15:33:54-05:00
OSThreads: Fix error code checking

pthread_join returns its error code and apparently doesn't set errno.

- - - - -
e391a16f by GHC GitLab CI at 2020-11-29T15:33:54-05:00
nonmoving: Don't join to mark_thread on shutdown

The mark thread is not joinable as we detach from it on creation.

- - - - -
60d088ab by Ben Gamari at 2020-11-29T15:33:54-05:00
nonmoving: Add reference to Ueno 2016

- - - - -
3aa60362 by GHC GitLab CI at 2020-11-29T15:33:54-05:00
nonmoving: Ensure that evacuated large objects are marked

See Note [Non-moving GC: Marking evacuated objects].

- - - - -
8d304a99 by Ben Gamari at 2020-11-30T10:15:22-05:00
rts/m32: Refactor handling of allocator seeding

Previously, in an attempt to reduce fragmentation, each new allocator
would map a region of M32_MAX_PAGES fresh pages to seed itself. However,
this ends up being extremely wasteful since it turns out that we often
use fewer than this.  Consequently, these pages end up getting freed
which, ends up fragmenting our address space more than than we would
have if we had naively allocated pages on-demand.

Here we refactor m32 to avoid this waste while achieving the
fragmentation mitigation previously desired. In particular, we move all
page allocation into the global m32_alloc_page, which will pull a page
from the free page pool. If the free page pool is empty we then refill
it by allocating a region of M32_MAP_PAGES and adding them to the pool.

Furthermore, we do away with the initial seeding entirely. That is, the
allocator starts with no active pages: pages are rather allocated on an
as-needed basis.

On the whole this ends up being a pleasingly simple change,
simultaneously making m32 more efficient, more robust, and simpler.

Fixes #18980.

- - - - -
b6629289 by Ben Gamari at 2020-11-30T10:15:58-05:00
rts: Use CHECK instead of assert

Use the GHC wrappers instead of <assert.h>.

- - - - -
9f4efa6a by Ben Gamari at 2020-11-30T10:15:58-05:00
rts/linker: Replace some ASSERTs with CHECK

In the past some people have confused ASSERT, which is for checking
internal invariants, which CHECK, which should be used when checking
things that might fail due to bad input (and therefore should be enabled
even in the release compiler). Change some of these cases in the linker
to use CHECK.

- - - - -
0f8a4655 by Ryan Scott at 2020-11-30T10:16:34-05:00
Allow deploy:pages job to fail

See #18973.

- - - - -
49ebe369 by chessai at 2020-11-30T19:47:40-05:00
Optimisations in Data.Foldable (T17867)

This PR concerns the following functions from `Data.Foldable`:
* minimum
* maximum
* sum
* product
* minimumBy
* maximumBy

- Default implementations of these functions now use `foldl'` or `foldMap'`.
- All have been marked with INLINEABLE to make room for further optimisations.

- - - - -
4d79ef65 by chessai at 2020-11-30T19:47:40-05:00
Apply suggestion to libraries/base/Data/Foldable.hs
- - - - -
6af074ce by chessai at 2020-11-30T19:47:40-05:00
Apply suggestion to libraries/base/Data/Foldable.hs
- - - - -
ab334262 by Viktor Dukhovni at 2020-11-30T19:48:17-05:00
dirty MVAR after mutating TSO queue head

While the original head and tail of the TSO queue may be in the same
generation as the MVAR, interior elements of the queue could be younger
after a GC run and may then be exposed by putMVar operation that updates
the queue head.

Resolves #18919

- - - - -
5eb163f3 by Ben Gamari at 2020-11-30T19:48:53-05:00
rts/linker: Don't allow shared libraries to be loaded multiple times

- - - - -
490aa14d by Ben Gamari at 2020-11-30T19:48:53-05:00
rts/linker: Initialise CCSs from native shared objects

- - - - -
6ac3db5f by Ben Gamari at 2020-11-30T19:48:53-05:00
rts/linker: Move shared library loading logic into Elf.c

- - - - -
b6698d73 by GHC GitLab CI at 2020-11-30T19:48:53-05:00
rts/linker: Don't declare dynamic objects with image_mapped

This previously resulted in warnings due to spurious unmap failures.

- - - - -
b94a65af by jneira at 2020-11-30T19:49:31-05:00
Include tried paths in findToolDir error

- - - - -
72a87fbc by Richard Eisenberg at 2020-12-01T19:57:41-05:00
Move core flattening algorithm to Core.Unify

This sets the stage for a later change, where this
algorithm will be needed from GHC.Core.InstEnv.

This commit also splits GHC.Core.Map into
GHC.Core.Map.Type and GHC.Core.Map.Expr,
in order to avoid module import cycles
with GHC.Core.

- - - - -
0dd45d0a by Richard Eisenberg at 2020-12-01T19:57:41-05:00
Bump the # of commits searched for perf baseline

The previous value of 75 meant that a feature branch with
more than 75 commits would get spurious CI passes.

This affects #18692, but does not fix that ticket, because
if a baseline cannot be found, we should fail, not succeed.

- - - - -
8bb52d91 by Richard Eisenberg at 2020-12-01T19:57:41-05:00
Remove flattening variables

This patch redesigns the flattener to simplify type family applications
directly instead of using flattening meta-variables and skolems. The key new
innovation is the CanEqLHS type and the new CEqCan constraint (Ct). A CanEqLHS
is either a type variable or exactly-saturated type family application; either
can now be rewritten using a CEqCan constraint in the inert set.

Because the flattener no longer reduces all type family applications to
variables, there was some performance degradation if a lengthy type family
application is now flattened over and over (not making progress). To
compensate, this patch contains some extra optimizations in the flattener,
leading to a number of performance improvements.

Close #18875.
Close #18910.

There are many extra parts of the compiler that had to be affected in writing
this patch:

* The family-application cache (formerly the flat-cache) sometimes stores
  coercions built from Given inerts. When these inerts get kicked out, we must
  kick out from the cache as well. (This was, I believe, true previously, but
  somehow never caused trouble.) Kicking out from the cache requires adding a
  filterTM function to TrieMap.

* This patch obviates the need to distinguish "blocking" coercion holes from
  non-blocking ones (which, previously, arose from CFunEqCans). There is thus
  some simplification around coercion holes.

* Extra commentary throughout parts of the code I read through, to preserve
  the knowledge I gained while working.

* A change in the pure unifier around unifying skolems with other types.
  Unifying a skolem now leads to SurelyApart, not MaybeApart, as documented
  in Note [Binding when looking up instances] in GHC.Core.InstEnv.

* Some more use of MCoercion where appropriate.

* Previously, class-instance lookup automatically noticed that e.g. C Int was
  a "unifier" to a target [W] C (F Bool), because the F Bool was flattened to
  a variable. Now, a little more care must be taken around checking for
  unifying instances.

* Previously, tcSplitTyConApp_maybe would split (Eq a => a). This is silly,
  because (=>) is not a tycon in Haskell. Fixed now, but there are some
  knock-on changes in e.g. TrieMap code and in the canonicaliser.

* New function anyFreeVarsOf{Type,Co} to check whether a free variable
  satisfies a certain predicate.

* Type synonyms now remember whether or not they are "forgetful"; a forgetful
  synonym drops at least one argument. This is useful when flattening; see
  flattenView.

* The pattern-match completeness checker invokes the solver. This invocation
  might need to look through newtypes when checking representational equality.
  Thus, the desugarer needs to keep track of the in-scope variables to know
  what newtype constructors are in scope. I bet this bug was around before but
  never noticed.

* Extra-constraints wildcards are no longer simplified before printing.
  See Note [Do not simplify ConstraintHoles] in GHC.Tc.Solver.

* Whether or not there are Given equalities has become slightly subtler.
  See the new HasGivenEqs datatype.

* Note [Type variable cycles in Givens] in GHC.Tc.Solver.Canonical
  explains a significant new wrinkle in the new approach.

* See Note [What might match later?] in GHC.Tc.Solver.Interact, which
  explains the fix to #18910.

* The inert_count field of InertCans wasn't actually used, so I removed
  it.

Though I (Richard) did the implementation, Simon PJ was very involved
in design and review.

This updates the Haddock submodule to avoid #18932 by adding
a type signature.

-------------------------
Metric Decrease:
    T12227
    T5030
    T9872a
    T9872b
    T9872c
Metric Increase:
    T9872d
-------------------------

- - - - -
d66660ba by Richard Eisenberg at 2020-12-01T19:57:41-05:00
Rename the flattener to become the rewriter.

Now that flattening doesn't produce flattening variables,
it's not really flattening anything: it's rewriting. This
change also means that the rewriter can no longer be confused
the core flattener (in GHC.Core.Unify), which is sometimes used
during type-checking.

- - - - -
add0aeae by Ben Gamari at 2020-12-01T19:58:17-05:00
rts: Introduce mmapAnonForLinker

Previously most of the uses of mmapForLinker were mapping anonymous
memory, resulting in a great deal of unnecessary repetition. Factor this
out into a new helper.

Also fixes a few places where error checking was missing or suboptimal.

- - - - -
97d71646 by Ben Gamari at 2020-12-01T19:58:17-05:00
rts/linker: Introduce munmapForLinker

Consolidates munmap calls to ensure consistent error handling.

- - - - -
d8872af0 by Ben Gamari at 2020-12-01T19:58:18-05:00
rts/Linker: Introduce Windows implementations for mmapForLinker, et al.

- - - - -
c35d0e03 by Ben Gamari at 2020-12-01T19:58:18-05:00
rts/m32: Introduce NEEDS_M32 macro

Instead of relying on RTS_LINKER_USE_MMAP

- - - - -
41c64eb5 by Ben Gamari at 2020-12-01T19:58:18-05:00
rts/linker: Use m32 to allocate symbol extras in PEi386

- - - - -
e0b08c5f by Ben Gamari at 2020-12-03T13:01:47-05:00
gitlab-ci: Fix copy-paste error

Also be more consistent in quoting.

- - - - -
33ec3a06 by Ben Gamari at 2020-12-03T23:11:31-05:00
gitlab-ci: Run linters through ci.sh

Ensuring that the right toolchain is used.

- - - - -
4a437bc1 by Shayne Fletcher at 2020-12-05T09:06:38-05:00
Fix bad span calculations of post qualified imports

- - - - -
8fac4b93 by Ben Gamari at 2020-12-05T09:07:13-05:00
testsuite: Add a test for #18923

- - - - -
62ed6957 by Simon Peyton Jones at 2020-12-08T15:31:41-05:00
Fix kind inference for data types. Again.

This patch fixes several aspects of kind inference for data type
declarations, especially data /instance/ declarations

Specifically

1. In kcConDecls/kcConDecl make it clear that the tc_res_kind argument
   is only used in the H98 case; and in that case there is no result
   kind signature; and hence no need for the disgusting splitPiTys in
   kcConDecls (now thankfully gone).

   The GADT case is a bit different to before, and much nicer.
   This is what fixes #18891.

   See Note [kcConDecls: kind-checking data type decls]

2. Do not look at the constructor decls of a data/newtype instance
   in tcDataFamInstanceHeader. See GHC.Tc.TyCl.Instance
   Note [Kind inference for data family instances].  This was a
   new realisation that arose when doing (1)

   This causes a few knock-on effects in the tests suite, because
   we require more information than before in the instance /header/.

   New user-manual material about this in "Kind inference in data type
   declarations" and "Kind inference for data/newtype instance
   declarations".

3. Minor improvement in kcTyClDecl, combining GADT and H98 cases

4. Fix #14111 and #8707 by allowing the header of a data instance
   to affect kind inferece for the the data constructor signatures;
   as described at length in Note [GADT return types] in GHC.Tc.TyCl

   This led to a modest refactoring of the arguments (and argument
   order) of tcConDecl/tcConDecls.

5. Fix #19000 by inverting the sense of the test in new_locs
   in GHC.Tc.Solver.Canonical.canDecomposableTyConAppOK.

- - - - -
0abe3ddf by Adam Sandberg Ericsson at 2020-12-08T15:32:19-05:00
hadrian: build the _l and _thr_l rts flavours in the develN flavours

The ghc binary requires the eventlog rts since
fc644b1a643128041cfec25db84e417851e28bab

- - - - -
51e3bb6d by Andreas Klebinger at 2020-12-08T22:43:21-05:00
CodeGen: Make folds User/DefinerOfRegs INLINEABLE.

Reduces allocation for the test case I was looking at by about 1.2%.
Mostly from avoiding allocation of some folding functions which turn
into let-no-escape bindings which just reuse their environment instead.

We also force inlining in a few key places in CmmSink which helps a bit
more.

- - - - -
69ae10c3 by Andreas Klebinger at 2020-12-08T22:43:21-05:00
CmmSink: Force inlining of foldRegsDefd

Helps avoid allocating the folding function. Improves
perf for T3294 by about 1%.

- - - - -
6e3da800 by Andreas Klebinger at 2020-12-08T22:43:21-05:00
Cmm: Make a few types and utility function slightly stricter.

About 0.6% reduction in allocations for the code I was looking at.

Not a huge difference but no need to throw away performance.

- - - - -
aef44d7f by Andreas Klebinger at 2020-12-08T22:43:21-05:00
Cmm.Sink: Optimize retaining of assignments, live sets.

Sinking requires us to track live local regs after each
cmm statement. We used to do this via "Set LocalReg".

However we can replace this with a solution based on IntSet
which is overall more efficient without losing much. The thing
we lose is width of the variables, which isn't used by the sinking
pass anyway.

I also reworked how we keep assignments to regs mentioned in
skipped assignments. I put the details into
Note [Keeping assignemnts mentioned in skipped RHSs].

The gist of it is instead of keeping track of it via the use count
which is a `IntMap Int` we now use the live regs set (IntSet) which
is quite a bit faster.

I think it also matches the semantics a lot better. The skipped
(not discarded) assignment does in fact keep the regs on it's rhs
alive so keeping track of this in the live set seems like the clearer
solution as well.

Improves allocations for T3294 by yet another 1%.

- - - - -
59f2249b by Andreas Klebinger at 2020-12-08T22:43:21-05:00
GHC.Cmm.Opt: Be stricter in results.

Optimization either returns Nothing if nothing is to be done or
`Just <cmmExpr>` otherwise. There is no point in being lazy in
`cmmExpr`. We usually inspect this element so the thunk gets forced
not long after.

We might eliminate it as dead code once in a blue moon but that's
not a case worth optimizing for.

Overall the impact of this is rather low. As Cmm.Opt doesn't allocate
much (compared to the rest of GHC) to begin with.

- - - - -
54b88eac by Andreas Klebinger at 2020-12-08T22:43:57-05:00
Bump time submodule.

This should fix #19002.

- - - - -
35e7b0c6 by Kirill Elagin at 2020-12-10T01:45:54-05:00
doc: Clarify the default for -fomit-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.
- - - - -
3551c554 by Kirill Elagin at 2020-12-10T01:45:54-05:00
doc: Extra-clarify -fomit-yields

Be more clear on what this optimisation being on by default means
in terms of yields.
- - - - -
6484f0d7 by Sergei Trofimovich at 2020-12-10T01:46:33-05:00
rts/linker/Elf.c: add missing <dlfcn.h> include (musl support)

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 at gentoo.org>

- - - - -
ab24ed9b by Ben Gamari at 2020-12-11T03:55:51-05:00
users guide: Fix syntax errors

Fixes errors introduced by 3a55b3a2574f913d046f3a6f82db48d7f6df32e3.

- - - - -
d3a24d31 by Ben Gamari at 2020-12-11T03:55:51-05:00
users guide: Describe GC lifecycle events

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.

- - - - -
741309b9 by Ben Gamari at 2020-12-11T03:56:27-05:00
gitlab-ci: Fix incorrect Docker image for nightly cross job

Also refactor the job definition to eliminate the bug by construction.

- - - - -
19703bc8 by Ben Gamari at 2020-12-11T03:56:27-05:00
gitlab-ci: Fix name of flavour in ThreadSanitizer job

It looks like I neglected to update this after introduce flavour
transformers.

- - - - -
381eb660 by Sylvain Henry at 2020-12-11T12:57:35-05:00
Display FFI labels (fix #18539)

- - - - -
4548d1f8 by Aaron Allen at 2020-12-11T12:58:14-05:00
Elide extraneous messages for :doc command (#15784)

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.

- - - - -
5eba91b6 by Aaron Allen at 2020-12-11T12:58:14-05:00
Add :doc test case for duplicate record fields

Tests that the output of the `:doc` command is correct for duplicate
record fields defined using -XDuplicateRecordFields.

- - - - -
5feb9b2d by Ryan Scott at 2020-12-11T22:39:29-05:00
Delete outdated Note [Kind-checking tyvar binders for associated types]

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]

- - - - -
f9f9f030 by Sylvain Henry at 2020-12-11T22:40:08-05:00
Arrows: correctly query arrow methods (#17423)

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

- - - - -
aaa8f00f by Sylvain Henry at 2020-12-11T22:40:48-05:00
Validate script: fix configure command when using stack

- - - - -
b4a929a1 by Sylvain Henry at 2020-12-11T22:41:30-05:00
Hadrian: fix libffi tarball parsing

Fix parsing of "libffi-3.3.tar.gz".

NB: switch to a newer libffi isn't done in this patch

- - - - -
690c8946 by Sylvain Henry at 2020-12-11T22:42:09-05:00
Parser: move parser utils into their own module

Move code unrelated to runtime evaluation out of GHC.Runtime.Eval

- - - - -
76be0e32 by Sylvain Henry at 2020-12-11T22:42:48-05:00
Move SizedSeq into ghc-boot

- - - - -
3a16d764 by Sylvain Henry at 2020-12-11T22:42:48-05:00
ghci: don't compile unneeded modules

- - - - -
2895fa60 by Sylvain Henry at 2020-12-11T22:42:48-05:00
ghci: reuse Arch from ghc-boot

- - - - -
480a38d4 by Sylvain Henry at 2020-12-11T22:43:30-05:00
rts: don't use siginterrupt (#19019)

- - - - -
4af6126d by Sylvain Henry at 2020-12-11T22:44:11-05:00
Use static array in zeroCount

- - - - -
5bd71bfd by Sebastian Graf at 2020-12-12T04:45:09-05:00
DmdAnal: Annotate top-level function bindings with demands (#18894)

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.

- - - - -
3aae036e by Sebastian Graf at 2020-12-12T04:45:09-05:00
Demand: Simplify `CU(U)` to `U` (#19005)

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.

- - - - -
c6477639 by Adam Sandberg Ericsson at 2020-12-12T04:45:48-05:00
hadrian: correctly copy the docs dir into the bindist #18669

- - - - -
e033dd05 by Adam Sandberg Ericsson at 2020-12-12T10:52:19+00:00
mkDocs: support hadrian bindists #18973

- - - - -
78580ba3 by John Ericson at 2020-12-13T07:14:50-05:00
Remove old .travis.yml

- - - - -
bacc459b by Simon Peyton Jones at 2020-12-14T16:08:46+00:00
Quick Look: zonk result type

Provoked by #18987, this patch adds a missing zonkQuickLook of
app_res_rho in tcApp.

Most of the time this zonk is unnecesary. In fact, I can't think of a
concrete case where it is needed -- hence no test.  But even if it
isn't necessary, the reasoning that allows it to be omitted is very
subtle. So I've put it in.

However, adding this zonk does /not/ affect the emitted constraints,
so the reported symptoms for #18987 remain, but harmlessly so, and now
documented in a new Note [Instantiation variables are short lived]
in GHC.Tc.Gen.App.

No change in behaviour, no tests.

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/ci.sh
- − .travis.yml
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Linker.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/Dataflow/Label.hs
- compiler/GHC/Cmm/Expr.hs
- + compiler/GHC/Cmm/LRegSet.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion.hs-boot
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/FVs.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c2e0eae643d07916af2886c28fd015f781b5c475...bacc459be24bb589d7a4417923944ce5767ef451

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c2e0eae643d07916af2886c28fd015f781b5c475...bacc459be24bb589d7a4417923944ce5767ef451
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201214/a55027e7/attachment-0001.html>


More information about the ghc-commits mailing list