<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>



<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<h3>
Ben Gamari pushed to branch wip/T13253
at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c2cfdfde20d0d6c0e16aa7a84d8ebe51501bcfa8">c2cfdfde</a></strong>
<div>
<span>by Aaron Allen</span>
<i>at 2020-07-13T09:00:33-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Warn about empty Char enumerations (#18402)

Currently the "Enumeration is empty" warning (-Wempty-enumerations)
only fires for numeric literals. This patch adds support for `Char`
literals so that enumerating an empty list of `Char`s will also
trigger the warning.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c3ac87ece2716b83ad886e81c20f4161e8ec0efd">c3ac87ec</a></strong>
<div>
<span>by Stefan Schulze Frielinghaus</span>
<i>at 2020-07-13T09:01:10-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">hadrian: build check-ppr dynamic if GHC is build dynamic

Fixes #18361
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9ad072b487fe528947f817b0417933a6cd1941b7">9ad072b4</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-07-13T14:52:49-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Use dumpStyle when printing inlinings

This just makes debug-printing consistent,
and more informative.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e78c4efb8735eb97f17e7b4ca35e305b0766f78a">e78c4efb</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-07-13T14:52:49-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Comments only
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7ccb760b1a8034b28171d7540712fd195f65d1fd">7ccb760b</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-07-13T14:52:49-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Reduce result discount in conSize

Ticket #18282 showed that the result discount given by conSize
was massively too large.  This patch reduces that discount to
a constant 10, which just balances the cost of the constructor
application itself.

Note [Constructor size and result discount] elaborates, as
does the ticket #18282.

Reducing result discount reduces inlining, which affects perf.  I
found that I could increase the unfoldingUseThrehold from 80 to 90 in
compensation; in combination with the result discount change I get
these overall nofib numbers:

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
          boyer          -0.2%     +5.4%     -3.2%     -3.4%      0.0%
       cichelli          -0.1%     +5.9%    -11.2%    -11.7%      0.0%
      compress2          -0.2%     +9.6%     -6.0%     -6.8%      0.0%
   cryptarithm2          -0.1%     -3.9%     -6.0%     -5.7%      0.0%
         gamteb          -0.2%     +2.6%    -13.8%    -14.4%      0.0%
         genfft          -0.1%     -1.6%    -29.5%    -29.9%      0.0%
             gg          -0.0%     -2.2%    -17.2%    -17.8%    -20.0%
           life          -0.1%     -2.2%    -62.3%    -63.4%      0.0%
           mate          +0.0%     +1.4%     -5.1%     -5.1%    -14.3%
         parser          -0.2%     -2.1%     +7.4%     +6.7%      0.0%
      primetest          -0.2%    -12.8%    -14.3%    -14.2%      0.0%
         puzzle          -0.2%     +2.1%    -10.0%    -10.4%      0.0%
            rsa          -0.2%    -11.7%     -3.7%     -3.8%      0.0%
         simple          -0.2%     +2.8%    -36.7%    -38.3%     -2.2%
   wheel-sieve2          -0.1%    -19.2%    -48.8%    -49.2%    -42.9%
--------------------------------------------------------------------------------
            Min          -0.4%    -19.2%    -62.3%    -63.4%    -42.9%
            Max          +0.3%     +9.6%     +7.4%    +11.0%    +16.7%
 Geometric Mean          -0.1%     -0.3%    -17.6%    -18.0%     -0.7%

I'm ok with these numbers, remembering that this change removes
an *exponential* increase in code size in some in-the-wild cases.

I investigated compress2.  The difference is entirely caused by this
function no longer inlining

WriteRoutines.$woutputCodes
  = \ (w :: [CodeEvent]) ->
      let result_s1Sr
            = case WriteRoutines.outputCodes_$s$woutput w 0# 0# 8# 9# of
                (# ww1, ww2 #) -> (ww1, ww2)
      in (# case result_s1Sr of (x, _) ->
              map @Int @Char WriteRoutines.outputCodes1 x
         , case result_s1Sr of { (_, y) -> y } #)

It was right on the cusp before, driven by the excessive result
discount.  Too bad!

Happily, the compiler/perf tests show a number of improvements:
    T12227     compiler bytes-alloc  -6.6%
    T12545     compiler bytes-alloc  -4.7%
    T13056     compiler bytes-alloc  -3.3%
    T15263     runtime  bytes-alloc -13.1%
    T17499     runtime  bytes-alloc -14.3%
    T3294      compiler bytes-alloc  -1.1%
    T5030      compiler bytes-alloc -11.7%
    T9872a     compiler bytes-alloc  -2.0%
    T9872b     compiler bytes-alloc  -1.2%
    T9872c     compiler bytes-alloc  -1.5%

Metric Decrease:
    T12227
    T12545
    T13056
    T15263
    T17499
    T3294
    T5030
    T9872a
    T9872b
    T9872c
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7f0b671ee8a65913891c07f157b21d77d6c63036">7f0b671e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-07-13T14:52:49-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Widen acceptance threshold on T5837

This test is positively tiny and consequently the bytes allocated
measurement will be relatively noisy. Consequently I have seen this
fail spuriously quite often.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/dfa4a337ecb33314d8ceaef6a9266cd95005e22e">dfa4a337</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-07-14T10:00:00-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">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.
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#bac3d5159a5688007de3aa3f5c4e50569677b347">
compiler/GHC/Core/Opt/OccurAnal.hs
</a>
</li>
<li class="file-stats">
<a href="#cc763cdd1967f5d921161a32f64136cfcf0332c5">
compiler/GHC/Core/Opt/SetLevels.hs
</a>
</li>
<li class="file-stats">
<a href="#f168a93cde5e2aec2441d6331dfe500172df4af3">
compiler/GHC/Core/Opt/Simplify.hs
</a>
</li>
<li class="file-stats">
<a href="#48fbb5cdea308650de5756521feb28ec68819b9b">
compiler/GHC/Core/Opt/Simplify/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#11ffe98a94d798427bc600e4fcfe899407536346">
compiler/GHC/Core/SimpleOpt.hs
</a>
</li>
<li class="file-stats">
<a href="#2811a7297b8aa206197ac1f5dabd0818e3c7ec5a">
compiler/GHC/Core/Unfold.hs
</a>
</li>
<li class="file-stats">
<a href="#774d88050336ef660c7a219fb06c480c2fc639bc">
compiler/GHC/Driver/Session.hs
</a>
</li>
<li class="file-stats">
<a href="#f017e4c978a9ff341ce5a7b838787fd2a4758b59">
compiler/GHC/HsToCore/Match/Literal.hs
</a>
</li>
<li class="file-stats">
<a href="#81707f1fe21087531cefd70879aa09c2be5c1d22">
compiler/GHC/Tc/Solver/Flatten.hs
</a>
</li>
<li class="file-stats">
<a href="#166e3514d27c63ef7e86af29830d9e8b2a31c8b1">
compiler/GHC/Types/Basic.hs
</a>
</li>
<li class="file-stats">
<a href="#38110817cdbc9a34d2b80a14070cabc7515c808a">
compiler/GHC/Types/Id/Info.hs
</a>
</li>
<li class="file-stats">
<a href="#4b733eb61cfe8a0a7189e1f5fcf412fdb852c3a6">
hadrian/src/Rules/Test.hs
</a>
</li>
<li class="file-stats">
<a href="#b74ba5875fd7cccd72bb96f5e09ffd324e58a963">
testsuite/tests/deSugar/should_compile/T13208.stdout
</a>
</li>
<li class="file-stats">
<a href="#941cab631058a932f5b548d7ef1ec5735a95df46">
testsuite/tests/deSugar/should_compile/T16615.stderr
</a>
</li>
<li class="file-stats">
<a href="#3fa1c31577a138583da8f797e3719b53c0247443">
testsuite/tests/dependent/should_compile/dynamic-paper.stderr
</a>
</li>
<li class="file-stats">
<a href="#73459bdd68c8a1d83dd2fc05500d4d379b541a3d">
testsuite/tests/numeric/should_compile/T14170.stdout
</a>
</li>
<li class="file-stats">
<a href="#68981928c0d335390bba962b95dc1104a8881d05">
testsuite/tests/numeric/should_compile/T14465.stdout
</a>
</li>
<li class="file-stats">
<a href="#e6a25af732cafed9cd91b716ddbdb29b303bd865">
testsuite/tests/numeric/should_compile/T7116.stdout
</a>
</li>
<li class="file-stats">
<a href="#9856dc5a4674b6f62977f48c1f04853d4a567961">
<span class="new-file">
+
testsuite/tests/perf/compiler/T10421.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#0184e9a52eb2baf5f839713779cf06cac224d755">
<span class="new-file">
+
testsuite/tests/perf/compiler/T10421_Form.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#fc1b1f4f4d3cd9abfc943223dfcfaa28517401c4">
<span class="new-file">
+
testsuite/tests/perf/compiler/T10421_Y.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#6cded300cd59c6c6bd64f4fe380e9248a339c2bf">
<span class="new-file">
+
testsuite/tests/perf/compiler/T13253-spj.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#2546b50520bb12b5295e3396e1c0f536b4a19c47">
<span class="new-file">
+
testsuite/tests/perf/compiler/T13253.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#0ec8c7a42ce4c1d4caa408ab9cde327d64463cbf">
<span class="new-file">
+
testsuite/tests/perf/compiler/T18140.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#ec1e5d16b27c7ff3995d36d70de8719cad4fc9e6">
<span class="new-file">
+
testsuite/tests/perf/compiler/T18282.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#fd4a0b65d74153aed8b33b01a04eb3ff7442cd45">
testsuite/tests/perf/compiler/all.T
</a>
</li>
<li class="file-stats">
<a href="#6e2ce964ea02e92c2202946150700a3219beed86">
testsuite/tests/simplCore/should_compile/T13143.stderr
</a>
</li>
<li class="file-stats">
<a href="#9919130b592f579ef1d69cf7e5576144fffa293f">
testsuite/tests/simplCore/should_compile/T15445.stderr
</a>
</li>
<li class="file-stats">
<a href="#bbbedc83ff419605896829035ab2d4207fb9987b">
testsuite/tests/simplCore/should_compile/T15631.stdout
</a>
</li>
<li class="file-stats">
<a href="#76b1e7dce1b4954525a28c2fed28ba31ca27a964">
testsuite/tests/simplCore/should_compile/T17901.stdout
</a>
</li>
</ul>
<h5>The diff was not included because it is too large.</h5>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/adcf83e20c034a1c784a85ea8ca66e3fe7d7fec4...dfa4a337ecb33314d8ceaef6a9266cd95005e22e">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.haskell.org.
If you'd like to receive fewer emails, you can
adjust your notification settings.



</p>
</div>
</body>
</html>