<!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>
Sebastian Graf pushed to branch wip/T18793
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/a6dc4633905c3f51a8d2baac9043a03db2581b7a">a6dc4633</a></strong>
<div>
<span>by Sebastian Graf</span>
<i>at 2020-10-09T11:01:16+02:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Arity: Refactor fixed-point iteration in GHC.Core.Opt.Arity

Arity analysis used to propagate optimistic arity types during
fixed-point interation through the `ArityEnv`'s `ae_cheap_fun` field,
which is like `GHC.Core.Utils.exprIsCheap`, but also considers the
current iteration's optimistic arity, for the binder in question only.

In #18793, we have seen that this is a problematic design, because it
doesn't allow us to look through PAP bindings of that binder.

Hence this patch refactors to a more traditional form with an explicit
signature environment, in which we record the optimistic `ArityType` of
the binder in question (and at the moment is the *only* binder that is
recorded in the arity environment).
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8a5f97cb8b658b93bb3e2076894ade45d69701ce">8a5f97cb</a></strong>
<div>
<span>by Sebastian Graf</span>
<i>at 2020-10-09T11:01:42+02:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Arity analysis: Record arity types for non-recursive lets

In #18793, we saw a compelling example which requires us to look at
non-recursive let-bindings during arity analysis and unleash their arity
types at use sites.

After the refactoring in the previous patch, the needed change is quite
simple and very local to `arityType`'s defn for non-recurisve `Let`.

Apart from that, we had to get rid of the second item of
`Note [Dealing with bottoms]`, which was entirely a safety measure and
hindered optimistic fixed-point iteration.

Fixes #18793.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9d61d7fe431486768ed10d53b9f10887bf8bdc06">9d61d7fe</a></strong>
<div>
<span>by Sebastian Graf</span>
<i>at 2020-10-09T11:01:50+02:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Testsuite: Add dead arity analysis tests

We didn't seem to test these old tests at all, judging from their
expected output.
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#c3967bb9d3e8f5aae2dd111b5a335b48c21c1999">
compiler/GHC/Core/Opt/Arity.hs
</a>
</li>
<li class="file-stats">
<a href="#db603f869375afca615f480fe785567da6d0983c">
<span class="deleted-file">

testsuite/tests/arityanal/Main.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#bb099790e98768bc21d328251c4879b98730a37c">
<span class="deleted-file">

testsuite/tests/arityanal/Main.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#d11a4df8491eb39ba2735e7fe7ed59bd48dd314d">
testsuite/tests/arityanal/Makefile
</a>
</li>
<li class="file-stats">
<a href="#204270be3d7727e90b18ee7cadafb3bc0975739f">
<span class="deleted-file">

testsuite/tests/arityanal/f0.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#2c8e6ea9959e06d8e6dac33240e2f0860805d2e6">
<span class="deleted-file">

testsuite/tests/arityanal/f1.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#dd67d924f023da74b081a038becf105a5f8bc065">
<span class="deleted-file">

testsuite/tests/arityanal/f10.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#3b89975d32dbf8dc3b93eea76cae90abbf5ac2ac">
<span class="deleted-file">

testsuite/tests/arityanal/f11.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#ec42d068aa1dcddf1df7bff499d233805c7d3c8c">
<span class="deleted-file">

testsuite/tests/arityanal/f13.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#9e434346de769dfd5a2c9dbba1d710e1ae0c63c9">
<span class="deleted-file">

testsuite/tests/arityanal/f14.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#efe71fa8e2c02c6e8f0189806c8da50b67ea04d1">
<span class="deleted-file">

testsuite/tests/arityanal/f15.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#65e523fea8069a105a7aa527d3563d7d1d45fc6e">
<span class="deleted-file">

testsuite/tests/arityanal/f2.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#78f4a00d32e1d7e49c34883e5865651c438ef10f">
<span class="deleted-file">

testsuite/tests/arityanal/f3.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#67eddd5ab4b7c20c2cc28fe54b5639280a06488f">
<span class="deleted-file">

testsuite/tests/arityanal/f4.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#d9be628575cce98999c8602566af005567f3e9b4">
<span class="deleted-file">

testsuite/tests/arityanal/f5.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#c93b8b4ec898c628f6dfb06665ff301d01e3838c">
<span class="deleted-file">

testsuite/tests/arityanal/f6.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#3e76877b084081b41f45768f892fa7b6532c3387">
<span class="deleted-file">

testsuite/tests/arityanal/f7.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#d08644fd7a746e8da9ac8baa50025c7566716ac8">
<span class="deleted-file">

testsuite/tests/arityanal/f8.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#7296d1afaa0aef345645413c208ea0dad53f3570">
<span class="deleted-file">

testsuite/tests/arityanal/f9.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#b7442bc909b510aedaca8c4b21975887ee099fca">
<span class="deleted-file">

testsuite/tests/arityanal/prim.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#f95e40fa4f9ff5c75e584de349dee323ef0a6d78">
testsuite/tests/arityanal/f0.hs

testsuite/tests/arityanal/should_compile/Arity00.hs
</a>
</li>
<li class="file-stats">
<a href="#c98af7c58aa5756bf28f01cc1afa8afe43f6ac43">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/Arity00.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#6e12f6ddb7d8d12f6f0086ee4c00072531650688">
testsuite/tests/arityanal/f1.hs

testsuite/tests/arityanal/should_compile/Arity01.hs
</a>
</li>
<li class="file-stats">
<a href="#46fdea7197af7a69a0a0d1b96b0a0dab860a614b">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/Arity01.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#ff29e6a8a77103af8142c5473ac15c785037fd67">
testsuite/tests/arityanal/f2.hs

testsuite/tests/arityanal/should_compile/Arity02.hs
</a>
</li>
<li class="file-stats">
<a href="#d17dc73d83ae4f8e388a6375f61874dd8423a3d7">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/Arity02.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#af9f146c0ecc876255ada8e46605206f6e71ffc2">
testsuite/tests/arityanal/f3.hs

testsuite/tests/arityanal/should_compile/Arity03.hs
</a>
</li>
<li class="file-stats">
<a href="#10626459c163674d3f8465668ecf305d97f16d41">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/Arity03.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#b2edffa89e1be92f942a5b04d24ecebd66aa5e29">
testsuite/tests/arityanal/f4.hs

testsuite/tests/arityanal/should_compile/Arity04.hs
</a>
</li>
<li class="file-stats">
<a href="#6bde466587e782a5b7fd61f10ce3a979706ec4aa">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/Arity04.stderr
</span>
</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/afb26d12794f98f55e35f5c8115b93ca1f77c686...9d61d7fe431486768ed10d53b9f10887bf8bdc06">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>