This patch addresses the exponential blow-up in the simplifier.

Specifically:
  #13253 exponential inlining
  #10421 ditto
  #18140 strict constructors
  #18282 another nested-function call case

This patch makes two significant changes:

1. For Ids that are used at most once in each branch of a case,
   make the occurrence analyser record the total number of
   syntactic occurrences.  Then in postInlineUnconditionally
   use that info to avoid inling something many many times.

   Actual changes:
     * See the occ_n_br field of OneOcc.
     * postInlineUnconditionally
   See Note [Suppress exponential blowup] in GHC.Core.Opt.Simplify.Utils

2. Change the way that mkDupableCont handles StrictArg.
   The details are explained in GHC.Core.Opt.Simplify
      Note [Duplicating StrictArg]

Current nofib run

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
             VS          -0.3%   +115.9%    +12.1%    +11.2%      0.0%
         boyer2          -0.3%    +10.0%     +3.5%     +4.0%      0.0%
   cryptarithm2          -0.3%    +39.0%    +16.6%    +16.1%      0.0%
         gamteb          -0.3%     +4.1%     -0.0%     +0.4%      0.0%
     last-piece          -0.3%     +1.4%     -1.1%     -0.4%      0.0%
           mate          -0.4%    -11.1%     -8.5%     -9.0%      0.0%
     multiplier          -0.3%     -2.2%     -1.5%     -1.5%      0.0%
      transform          -0.3%     +3.4%     +0.5%     +0.8%      0.0%
--------------------------------------------------------------------------------
            Min          -0.8%    -11.1%     -8.5%     -9.0%      0.0%
            Max          -0.3%   +115.9%    +30.1%    +26.4%      0.0%
 Geometric Mean          -0.3%     +1.0%     +1.0%     +1.0%     -0.0%

Should investigate these numbers.

But the tickets are indeed cured, I think.
23 jobs for !3684 with wip/simon-perf in 100 minutes and 17 seconds (queued for 1 second)
detached
Status Job ID Name Coverage
  Lint
passed #391987
lint
ghc-linters

00:00:15

passed #391988
lint
lint-linters

00:00:15

passed #391991
lint
lint-submods

00:00:22

passed #391989
lint
lint-testsuite

00:00:16

passed #391990
lint
typecheck-testsuite

00:00:15

 
  Quick Build
passed #391992
x86_64-linux
hadrian-ghc-in-ghci

00:08:36

 
  Build
failed #391993
x86_64-linux
validate-x86_64-linux-deb9-hadrian

01:30:30

 
  Full Build
skipped #391996
aarch64-linux allowed to fail
validate-aarch64-linux-deb9
skipped #391997
armv7-linux allowed to fail
validate-armv7-linux-deb9
skipped #391998
x86_64-linux
validate-i386-linux-deb9
skipped #392005
new-x86_64-windows test allowed to fail
validate-i386-windows
skipped #391995
x86_64-darwin
validate-x86_64-darwin
skipped #391999
x86_64-linux
validate-x86_64-linux-deb9-debug
skipped #392001
x86_64-linux
validate-x86_64-linux-deb9-dwarf
skipped #392000
x86_64-linux
validate-x86_64-linux-deb9-integer-simple
skipped #391994
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian
skipped #392002
x86_64-linux
validate-x86_64-linux-fedora27
skipped #392004
new-x86_64-windows test allowed to fail
validate-x86_64-windows
skipped #392003
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian
 
  Cleanup
passed #392006
x86_64-darwin
cleanup-darwin

00:00:14

 
  Packaging
skipped #392007
x86_64-linux allowed to fail
doc-tarball
 
  Testing
skipped #392008
x86_64-linux allowed to fail manual
hackage
skipped #392009
x86_64-linux
perf-nofib
 
Name Stage Failure
failed
validate-x86_64-linux-deb9-hadrian Build
Running after script...
$ .gitlab/ci.sh clean
Running make --quiet clean...
Running rm -Rf _build...
Uploading artifacts for failed job
Uploading artifacts...
junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=391993 responseStatus=201 Created token=Msu7Mdpk
ERROR: Job failed: exit code 1