<!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>
Simon Peyton Jones pushed to branch wip/T18223
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/a77b9ec2a6153065565bca7bb154fff35b830b82">a77b9ec2</a></strong>
<div>
<span>by Krzysztof Gogolewski</span>
<i>at 2020-08-24T10:04:20-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Add a test for #18397

The bug was fixed by !3421.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/05550a5abc369e1cc4fc48def532ca9ba9adcad7">05550a5a</a></strong>
<div>
<span>by Sylvain Henry</span>
<i>at 2020-08-24T10:04:59-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Avoid roundtrip through SDoc

As found by @monoidal on https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3885#note_295126
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0a1ecc5fd45a46372c3935df596f05432db1b270">0a1ecc5f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-08-25T07:37:05-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">SysTools.Process: Handle exceptions in readCreateProcessWithExitCode'

In #18069 we are observing MVar deadlocks from somewhere in ghc.exe.
This use of MVar stood out as being one of the more likely culprits.
Here we make sure that it is exception-safe.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/db8793ad417ebfcb57d42e8111674a90706a7918">db8793ad</a></strong>
<div>
<span>by Richard Eisenberg</span>
<i>at 2020-08-25T07:37:40-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Use tcView, not coreView, in the pure unifier.

Addresses a lingering point within #11715.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/fb77207a23deade8e3f8598c34598535711264cc">fb77207a</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-08-25T07:38:16-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Use LIdP rather than (XRec p (IdP p))

This patch mainly just replaces use of
    XRec p (IdP p)
with
    LIdP p

One slightly more significant change is to parameterise
HsPatSynDetails over the pass rather than the argument type,
so that it's uniform with HsConDeclDetails and HsConPatDetails.

I also got rid of the dead code GHC.Hs.type.conDetailsArgs

But this is all just minor refactoring. No change in functionality.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8426a1364ba450fe48fc41a95b2ba76c8d1bb7c8">8426a136</a></strong>
<div>
<span>by Krzysztof Gogolewski</span>
<i>at 2020-08-25T07:38:54-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Add a test for #18585
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/6362994e6e6de297f4b8704a6386fd396312bd85">6362994e</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2020-08-26T00:04:07+01:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Better eta-expansion (again) and don't specilise DFuns

This patch fixes #18223, which made GHC generate an exponential
amount of code.  There are three quite separate changes in here

1.  Re-engineer eta-expansion (again).  The eta-expander was
    generating lots of intermediate stuff, which could be optimised
    away, but which choked the simplifier meanwhile.  Relatively
    easy to kill it off at source.

    See Note [The EtaInfo mechanism] in GHC.Core.Opt.Arity.
    The main new thing is the use of pushCoArg in getArg_maybe.

2.  Stop Specialise specalising DFuns.  This is the cause of a huge
    (and utterly unnecessary) blowup in program size in #18223.
    See Note [Do not specialise DFuns] in GHC.Core.Opt.Specialise.

    I also refactored the Specialise monad a bit... it was silly,
    because it passed on unchanging values as if they were mutable
    state.

3.  Do an extra Simplifer run, after SpecConstra and before
    late-Specialise.  I found (investigating perf/compiler/T16473)
    that failing to do this was crippling *both* SpecConstr *and*
    Specialise.  See Note [Simplify after SpecConstr] in
    GHC.Core.Opt.Pipeline.

    This change does mean an extra run of the Simplifier, but only
    with -O2, and I think that's acceptable.

    T16473 allocates *three* times less with this change.  (I changed
    it to check runtime rather than compile time.)

Some smaller consequences

* I moved pushCoercion, pushCoArg and friends from SimpleOpt
  to Arity, because it was needed by the new etaInfoApp.

  And pushCoValArg now returns a MCoercion rather than Coercion for
  the argument Coercion.

* A minor, incidental improvement to Core pretty-printing

This does fix #18223, (which was otherwise uncompilable. Hooray.  But
there is still a big intermediate because there are some very deeply
nested types in that program.

Modest reductions in compile-time allocation on a couple of benchmarks
  12425              -2.5%
  13253              -10.4%
  MultiLayerModules  -0.6%

Metric increase with -O2, due to extra simplifier run
    T9233     +5.8%
    T12227    +1.7%

Metric Increase
    T9233
    T12227
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#b131e0d591301ee7a1c76bbd812f3d14783e934f">
compiler/GHC/CmmToAsm/Dwarf.hs
</a>
</li>
<li class="file-stats">
<a href="#783e5dae6e86931f06700fc088fb7d48c8a07386">
compiler/GHC/Core/Coercion.hs
</a>
</li>
<li class="file-stats">
<a href="#c3967bb9d3e8f5aae2dd111b5a335b48c21c1999">
compiler/GHC/Core/Opt/Arity.hs
</a>
</li>
<li class="file-stats">
<a href="#bd153f89bc48f3fd5079b51fb799808aacbd750c">
compiler/GHC/Core/Opt/Pipeline.hs
</a>
</li>
<li class="file-stats">
<a href="#f168a93cde5e2aec2441d6331dfe500172df4af3">
compiler/GHC/Core/Opt/Simplify.hs
</a>
</li>
<li class="file-stats">
<a href="#2f46b19cb85e3f7b4e72305644bc50015628c41d">
compiler/GHC/Core/Opt/Simplify/Env.hs
</a>
</li>
<li class="file-stats">
<a href="#ab22d7ae4d245581b701367e386d7e886e416e76">
compiler/GHC/Core/Opt/Specialise.hs
</a>
</li>
<li class="file-stats">
<a href="#a8e2a1e5829eb3b4809201e0f47e91b64ce11b96">
compiler/GHC/Core/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#11ffe98a94d798427bc600e4fcfe899407536346">
compiler/GHC/Core/SimpleOpt.hs
</a>
</li>
<li class="file-stats">
<a href="#708fab0a51bd47227233eda4698e750ff6de66e0">
compiler/GHC/Core/Subst.hs
</a>
</li>
<li class="file-stats">
<a href="#84c9d3ba34173297e7d7747e02caa2e004b164fc">
compiler/GHC/Core/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#89a2e0e1a3095c7a42b10f2819049908908080e8">
compiler/GHC/Core/Unify.hs
</a>
</li>
<li class="file-stats">
<a href="#65ca06d51797ebf672a62bde6c00bcb9444e1425">
compiler/GHC/Hs/Binds.hs
</a>
</li>
<li class="file-stats">
<a href="#75bfcd03f3ba9315d33104fcb0424c6bfeb4e334">
compiler/GHC/Hs/Decls.hs
</a>
</li>
<li class="file-stats">
<a href="#cc97d81e7223ad4a3a5e801156ca632f9fa75654">
compiler/GHC/Hs/Expr.hs
</a>
</li>
<li class="file-stats">
<a href="#576dff4e64fa03683ffc5dcdd58284acdd70bc8e">
compiler/GHC/Hs/Extension.hs
</a>
</li>
<li class="file-stats">
<a href="#0bae7e7e67b5f9b6ba2a371f8917cf74423a0c6f">
compiler/GHC/Hs/Pat.hs
</a>
</li>
<li class="file-stats">
<a href="#018be522bc4813b147a1525e4f96a7a493207d96">
compiler/GHC/Hs/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#7a1af22e4c32b9aa6ec708d9d3788e1c4db5da9a">
compiler/GHC/Hs/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#b370399ae1ab68e37f0e631d98a45da6df9f011c">
compiler/GHC/HsToCore/Match/Constructor.hs
</a>
</li>
<li class="file-stats">
<a href="#3c19c0be465f9a28d7b69f89c55648080fcc37eb">
compiler/GHC/HsToCore/Quote.hs
</a>
</li>
<li class="file-stats">
<a href="#94864be2e2eb1959a038d5d903a6c784e5cfb32a">
compiler/GHC/HsToCore/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#bf951467d4a9aa443cb109cb4c84a2891945649b">
compiler/GHC/Parser.y
</a>
</li>
<li class="file-stats">
<a href="#7d3359a337486f9067d22455a38fdf75479921fb">
compiler/GHC/SysTools/Process.hs
</a>
</li>
<li class="file-stats">
<a href="#5c0a7f8291c984f0fc06f59e7cf10dbecc11598b">
compiler/GHC/Tc/TyCl/PatSyn.hs
</a>
</li>
<li class="file-stats">
<a href="#6a120b0673f8920127d8fffdaa16f01b90cc92d7">
compiler/GHC/Tc/Utils/Zonk.hs
</a>
</li>
<li class="file-stats">
<a href="#a124ae4cee4a921d9d303b0d3086102183c96d50">
<span class="new-file">
+
testsuite/tests/codeGen/should_compile/T18397.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#6b1c188363067aa37c05e3a281dad45535511b14">
testsuite/tests/codeGen/should_compile/all.T
</a>
</li>
<li class="file-stats">
<a href="#e1f1fd9ebe1a9c58f6f2c996009bd7dc94a4926c">
testsuite/tests/perf/compiler/Makefile
</a>
</li>
<li class="file-stats">
<a href="#b788976ba3555853d385fd1c6246444c972d749f">
testsuite/tests/perf/compiler/T16473.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/e3c76de3eb2a09d78ebc14cc5c11b667b69c5807...6362994e6e6de297f4b8704a6386fd396312bd85">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>