<!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;
}
body {
font-size: 0.875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";'>
<div class="content">
<h3 style="margin-top: 20px; margin-bottom: 10px;">
Simon Peyton Jones pushed to branch wip/T21694a
at <a href="https://gitlab.haskell.org/ghc/ghc" style="color: #1068bf; text-decoration: none;">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
Commits:
</h4>
<ul>
<li>
<strong style="font-weight: bold;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a90298cc7291677fddd9e374e222676306265c17" style="color: #1068bf; text-decoration: none;">a90298cc</a></strong>
<div>
<span>by Simon Peyton Jones</span>
<i>at 2022-08-25T08:38:16+01:00</i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 0.8125rem; color: #303030; position: relative; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; word-break: break-all; word-wrap: break-word; background-color: #fafafa; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dbdbdb;'>Fix arityType: -fpedantic-bottoms, join points, etc
This MR fixes #21694, #21755. It also makes sure that #21948 and
fix to #21694.
* For #21694 the underlying problem was that we were calling arityType
on an expression that had free join points. This is a Bad Bad Idea.
See Note [No free join points in arityType].
* To make "no free join points in arityType" work out I had to avoid
trying to use eta-expansion for runRW#. This entailed a few changes
in the Simplifier's treatment of runRW#. See
GHC.Core.Opt.Simplify.Iteration Note [No eta-expansion in runRW#]
* I also made andArityType work correctly with -fpedantic-bottoms;
see Note [Combining case branches: andWithTail].
* Rewrote Note [Combining case branches: optimistic one-shot-ness]
* arityType previously treated join points differently to other
let-bindings. This patch makes them unform; arityType analyses
the RHS of all bindings to get its ArityType, and extends am_sigs.
I realised that, now we have am_sigs giving the ArityType for
let-bound Ids, we don't need the (pre-dating) special code in
arityType for join points. But instead we need to extend the env for
Rec bindings, which weren't doing before. More uniform now. See
Note [arityType for let-bindings].
This meant we could get rid of ae_joins, and in fact get rid of
EtaExpandArity altogether. Simpler.
* And finally, it was the strange treatment of join-point Ids in
arityType (involving a fake ABot type) that led to a serious bug:
#21755. Fixed by this refactoring, which treats them uniformly;
but without breaking #18328.
In fact, the arity for recursive join bindings is pretty tricky;
see the long Note [Arity for recursive join bindings]
in GHC.Core.Opt.Simplify.Utils. That led to more refactoring,
including deciding that an Id could have an Arity that is bigger
than its JoinArity; see Note [Invariants on join points], item
2(b) in GHC.Core
* Make sure that the "demand threshold" for join points in DmdAnal
is no bigger than the join-arity. In GHC.Core.Opt.DmdAnal see
Note [Demand signatures are computed for a threshold arity based on idArity]
* I moved GHC.Core.Utils.exprIsDeadEnd into GHC.Core.Opt.Arity,
where it more properly belongs.
* Remove an old, redundant hack in FloatOut. The old Note was
Note [Bottoming floats: eta expansion] in GHC.Core.Opt.SetLevels.
Compile time improves very slightly on average:
Metrics: compile_time/bytes allocated
---------------------------------------------------------------------------------------
T18223(normal) ghc/alloc 725,808,720 747,839,216 +3.0% BAD
T6048(optasm) ghc/alloc 105,006,104 101,599,472 -3.2% GOOD
geo. mean -0.2%
minimum -3.2%
maximum +3.0%
For some reason Windows was better
T10421(normal) ghc/alloc 125,888,360 124,129,168 -1.4% GOOD
T18140(normal) ghc/alloc 85,974,520 83,884,224 -2.4% GOOD
T18698b(normal) ghc/alloc 236,764,568 234,077,288 -1.1% GOOD
T18923(normal) ghc/alloc 75,660,528 73,994,512 -2.2% GOOD
T6048(optasm) ghc/alloc 112,232,512 108,182,520 -3.6% GOOD
geo. mean -0.6%
I had a quick look at T18223 but it is knee deep in coercions and
the size of everything looks similar before and after. I decided
to accept that 3% increase in exchange for goodness elsewhere.
Metric Decrease:
T10421
T18140
T18698b
T18923
T6048
Metric Increase:
T18223
</pre>
</li>
</ul>
<h4 style="margin-top: 10px; margin-bottom: 10px;">24 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#182d6a315e784018aa9c8b2ad736036b97bd5d48" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core.hs
</a>
</li>
<li class="file-stats">
<a href="#36a42448a83a9d1f6df8475f03ead2eed199dd8e" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Lint.hs
</a>
</li>
<li class="file-stats">
<a href="#c3967bb9d3e8f5aae2dd111b5a335b48c21c1999" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/Arity.hs
</a>
</li>
<li class="file-stats">
<a href="#8104fa1b71db6cfc4eb90cd769463d9eb9004619" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/DmdAnal.hs
</a>
</li>
<li class="file-stats">
<a href="#0debbb6150cac3b9f1027e430021269925103bb9" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/FloatOut.hs
</a>
</li>
<li class="file-stats">
<a href="#cc763cdd1967f5d921161a32f64136cfcf0332c5" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/SetLevels.hs
</a>
</li>
<li class="file-stats">
<a href="#ae6d91a5d028418bbf1431347d659e744e0a3128" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/Simplify/Iteration.hs
</a>
</li>
<li class="file-stats">
<a href="#48fbb5cdea308650de5756521feb28ec68819b9b" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/Simplify/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#5b215b0e109123e4bef5434854f18e2f61c45b88" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Opt/WorkWrap.hs
</a>
</li>
<li class="file-stats">
<a href="#846e2566b022c9a12a5978ac7934d5b019fbea5c" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Tidy.hs
</a>
</li>
<li class="file-stats">
<a href="#1a7aba0daeafab195716dd25432479804a55ab60" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Core/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#d11203a9321005ba51a16d751c86f609d1f18c71" style="color: #1068bf; text-decoration: none;">
compiler/GHC/Iface/Tidy.hs
</a>
</li>
<li class="file-stats">
<a href="#96503bd50e628de9da0242ab177c86eba5b64474" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/T21755.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#576f5279ea2bb5d954894efc95d573c89a3cfb62" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/arityanal/should_compile/T21755.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#d67c329c07c6c486d54ae87ffc8be9188c198bcc" style="color: #1068bf; text-decoration: none;">
testsuite/tests/arityanal/should_compile/all.T
</a>
</li>
<li class="file-stats">
<a href="#d2e531cafb912fc0540736e56f7a82a9fe79ea14" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/arityanal/should_run/T21694a.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#fb0c13d4f609903a43ce2268d21b37131bfd60e7" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/arityanal/should_run/T21694a.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#37cc004016bdcee06901febdc23c026bb7d314b3" style="color: #1068bf; text-decoration: none;">
testsuite/tests/arityanal/should_run/all.T
</a>
</li>
<li class="file-stats">
<a href="#08465e123c47bc34bcd5659da5649ed460e3a059" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T21694.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#db96e68392030bcad7b2d68e5b5445c587a3305e" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T21694b.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#fdbbd1c56a6e4c0ee25b66b4638546534d407f6c" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T21694b.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#cda7ea853f6dc7b59bbe43b597df79cbbec163f0" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T21948.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#3edcb6046d4cfdd524783853f46516ab6c8e786c" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T21948.stderr
</span>
</a>
</li>
<li class="file-stats">
<a href="#8b02ce2eb145c8864b0cb398fe1b21ddf01966bf" style="color: #1068bf; text-decoration: none;">
<span class="new-file">
+
testsuite/tests/simplCore/should_compile/T21960.hs
</span>
</a>
</li>
</ul>
<h5 style="margin-top: 10px; margin-bottom: 10px; font-size: 0.875rem;">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: #666;">
—
<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a90298cc7291677fddd9e374e222676306265c17" style="color: #1068bf; text-decoration: none;">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.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.haskell.org/ghc/ghc/-/commit/a90298cc7291677fddd9e374e222676306265c17"}}</script>
</p>
</div>
</body>
</html>