Add BUILD_DPH variable to GHC build-system

Now that the `libraries/dph` submodule is checked out always we need
a different way to disable building DPH to save compile-time while
developing GHC.

This commit adds a new YES/NO Make variable `BUILD_DPH` that can be used
inside mk/build.mk to control whether to build libraries/dph or not.
The default setting is `BUILD_DPH=YES` (via `mk/config.mk.in`).

This also changes `validate`'s flag `--no-dph` to explicitly disable DPH
for the current validation run.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>

Test Plan: successful validates with `--fast --no-dph`

Differential Revision: https://phabricator.haskell.org/D31
Tyop in comment
Update Cabal to BinaryLiterals-aware 1.20 version

In 1c0b5fdc9f2b6ea8166cc565383d4cd20432343c (re #9224) `BinaryLiterals`
was temporarily added to T4437's `expectedGhcOnlyExtensions` list. This
can now reverted as Cabal has been made aware of `BinaryLiterals`
(see haskell/cabal#1970 and haskell/cabal#1972).

updates Cabal submodule

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Expect test failure for T8832 on 32bit (re #8832)

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Update 32bit & 64bit performance numbers

Some numbers have decreased but the haddock numbers have generally
increased noticeable again (see also last update in 970e5d99fb658b73)

This updates all numbers I noticed in the "fast" test-mode, *except* for
the T9203 test-case on 32bit, which needs more investigation before
bumping due to its significant increase:

  bytes allocated value is too high:
      Expected    bytes allocated: 50000000 +/-5%
      Lower bound bytes allocated: 47500000
      Upper bound bytes allocated: 52500000
      Actual      bytes allocated: 85093548
  *** unexpected failure for T9203(normal)
Promote TcNullaryTC and TcCoercible to fast tests

I'm wondering whether it's sensible to omit so many typecheck testcases from
the default validate test target. As for instance, TcNullaryTC has been failing
since its introduction in c63a465011b99eeafbb957074e54c2e6bbf751d9 (re #8993) and
it seems to have gone unnoticed so far.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Factor-out the `OverlapMode` from `OverlapFlag`.

This seems a bit cleaner conceptually because the overlap mode and running
in safety mode are quite orthogonal.

More pragmatically, it also makes it possible to use `OverlapMode` to let
programmers pick the overlap mode for individual instances.
Overlapable pragmas for individual instances (#9242)

Programmers may provide a pragma immediately after the `instance` keyword
to control the overlap/incoherence behavior for individual instances.
For example:

    instance {-# OVERLAP #-} C a where ...

I chose this notation, rather than the other two outlined in the ticket
for these reasons:

   1. Having the pragma after the type looks odd, I think.
   2. Having the pragma after there `where` does not work for
       stand-alone derived instances

I have implemented 3 pragams:

   1. NO_OVERLAP
   2. OVERLAP
   3. INCOHERENT

These correspond directly to the internal modes currently supported by
GHC.  If a pragma is specified, it will be used no matter what flags are
turned on.   For example, putting `NO_OVERLAP` on an instance will mark
it as non-overlapping, even if `OVERLAPPIN_INSTANCES` is turned on for the
module.
Eliminate `Unify.validKindShape` (#9242)
Document #8883 in the release notes
Remove dead code. Fix comment typo.
Revert "Fix obscure problem with using the system linker (#8935)"

This reverts commit 2f8b4c9330b455d4cb31c186c747a7db12a69251.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Re-add more primops for atomic ops on byte arrays

This is the second attempt to add this functionality. The first
attempt was reverted in 950fcae46a82569e7cd1fba1637a23b419e00ecd, due
to register allocator failure on x86. Given how the register
allocator currently works, we don't have enough registers on x86 to
support cmpxchg using complicated addressing modes. Instead we fall
back to a simpler addressing mode on x86.

Adds the following primops:

 * atomicReadIntArray#
 * atomicWriteIntArray#
 * fetchSubIntArray#
 * fetchOrIntArray#
 * fetchXorIntArray#
 * fetchAndIntArray#

Makes these pre-existing out-of-line primops inline:

 * fetchAddIntArray#
 * casIntArray#
Remove extraneous debugging output (#9071)
Avoid integer overflow in hp2ps (#9145)

This is slightly hackish, but hp2ps is already convoluted enough
that I don't feel bad about it.
Add a cast to new code in hp2ps

For parallelism with the existing code. I don't think it should
make any difference.
Unbreak TcNullaryTC testcase, by using MPTC
Replace thenM/thenM_ with do-notation in RnExpr
Refactor checkHiBootIface so that TcGblEnv is not necessary.

Summary:
This patch is a prelude to implementation of hi-to-hi compatibility
checking.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: simonpj, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D35
Update Haddock submodule with Iavor's validate fix.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>