Fix windows x86_64 build.

On win64 sizeof(long) != sizeof(void*), so debugTrace was casting a
value of incorrect size causing a validate failure.

Signed-off-by: Austin Seipp <austin@well-typed.com>
New flag: -ddump-strsigs

The existing flag -ddump-stranal dumps the full Core, which is very
verbose and not always helpful. This adds a more concise output (one
line per top-level bind) that is faster to read, and especially more
suitable to be used when writing test cases for the strictness analiser.
Do not forget CPR information after an IO action

but do forget about certain divergence, if required. Fixes one part of
ticket #8598.

The added function (deferAfterIO) can maybe be merged with existing
code, but given the ongoing work in the nested-cpr branch, I defer that
work.
Rename topDmdType to nopDmdType

because topDmdType is ''not'' the top of the lattice, as it puts an
implicit absent demand on free variables, but Abs is the bottom of the
Usage lattice.

Why nopDmdType? Becuase it is the demand of doing nothing: Everything
lazy, everything absent, no definite divergence.
Replace mkTopDmdType by mkClosedStrictSig

because it is not a top deman (see previous commit), and it is only used
in an argument to mkStrictSig.
Sort the output of -dump-strsigs
Add more .mailmap entries

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Do not generate given kind-equalities (fix Trac #8566)

This is a long-standing bug.  We were generating a Given
equality between kind variables, and (at least until we support
kind coercions) we can't do that.

The fix is to drop such Given equalities entirely. That may
mean we can't prove some things, but that's fair enough -- the
current proof language can't express such proofs.

See Note [Do not create Given kind equalities] in TcSMonad
Better debug printing
Spelling in comment
Some refactoring of Demand and DmdAnal

This was authored by SPJ and extracted from the "Improve the handling of
used-once stuff" patch by Joachim.
Do not split void functions

This is authored by SPJ, and split out out "Improve the handling of
used-once stuff" by Joachim.
Assign strictness signatures to primitive operations

This patch was authored by SPJ, and extracted from "Improve the handling
of used-once stuff" by Joachim.
Guarding against silly shifts

This patch was authored by SPJ and extracted from "Improve the handling
of used-once stuff" by Joachim.
Improve the handling of used-once stuff

Joachim and I are committing this onto a branch so that we can share it,
but we expect to do a bit more work before merging it onto head.

Nofib staus:
  - Most programs, no change
  - A few improve
  - A couple get worse (cacheprof, tak, rfib)
Investigating the "get worse" set is what's holding up putting this
on head.

The major issue is this.  Consider

    map (f g) ys

where f's demand signature looks like

   f :: <L,C1(C1(U))> -> <L,U> -> .

So 'f' is not saturated.  What demand do we place on g?
Answer
        C(C1(U))
That is, the inner C1 should stay, even though f is not saturated.

I found that this made a significant difference in the demand signatures
inferred in GHC.IO, which uses lots of higher-order exception handlers.

I also had to add used-once demand signatures for some of the
'catch' primops, so that we know their handlers are only called once.
Move peelFV from DmdAnal to Demand
Clarify the default demand on demand environments

by adding Notes and using easier to understand combinators.
Remove dmdAnalArg and replace by easier to understand code
Add Note [non-algebraic or open body type warning]
Split DmdResult into DmdResult and CPRResult

this is a small-step-refactoring patch and not very interesting on its
own.