<!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/dmdanal-split-fvs
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/c4176ed45aa296058417ac946ce785193be24b3a">c4176ed4</a></strong>
<div>
<span>by Sebastian Graf</span>
<i>at 2020-10-24T14:34:14+02:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">DmdAnal: Don't `splitFV` strict demands

The `splitFV` function implements the highly dubious hack
described in `Note [Lazy und unleashable free variables]` in
GHC.Core.Opt.DmdAnal. It arranges it so that demand signatures only
carry strictness info on free variables. Usage info is released through
other means, see the Note. It's purely for analysis performance reasons.

But in case of a strict FV demand, we still add the FV to the demand
signature *and* the lazy_fv DmdEnv. It would be far simpler (and more
precise) not having to split the demand over both places, if analysis
performance doesn't degrade too much.
</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class="file-stats">
<a href="#d09e98aae6ad2eb59d08eac7894b68c0ab820cda">
compiler/GHC/Types/Demand.hs
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="d09e98aae6ad2eb59d08eac7894b68c0ab820cda">
<a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c4176ed45aa296058417ac946ce785193be24b3a#d09e98aae6ad2eb59d08eac7894b68c0ab820cda"><strong>compiler/GHC/Types/Demand.hs</strong></a>
<hr>
<table class="code white" style="font-family: monospace; font-size: 90%;" bgcolor="#fff" width="100%" cellpadding="0" cellspacing="0">
<tr class="line_holder match" id="" style="line-height: 1.6;">
<td class="diff-line-num unfold js-unfold old_line" data-linenumber="806" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="diff-line-num unfold js-unfold new_line" data-linenumber="806" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="line_content match " style="padding-left: 0.5em; padding-right: 0.5em; color: rgba(0,0,0,0.3);" bgcolor="#fafafa">@@ -806,11 +806,9 @@ splitFVs is_thunk rhs_fvs</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="806" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
806
</td>
<td class="diff-line-num new_line" data-linenumber="806" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
806
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC806" class="line" lang="haskell">                <span class="c1" style="color: #998; font-style: italic;">-- in the envs again</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="807" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
807
</td>
<td class="diff-line-num new_line" data-linenumber="807" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
807
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC807" class="line" lang="haskell">  <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">otherwise</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">partitionVarEnv</span> <span class="n" style="color: #333;">isWeakDmd</span> <span class="n" style="color: #333;">rhs_fvs</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="808" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
808
</td>
<td class="diff-line-num new_line" data-linenumber="808" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
808
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC808" class="line" lang="haskell">  <span class="kr" style="font-weight: 600;">where</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="809" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
809
</td>
<td class="diff-line-num new_line old" data-linenumber="809" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC809" class="line" lang="haskell">    <span class="n" style="color: #333;">add</span> <span class="n" style="color: #333;">uniq</span> <span class="n" style="color: #333;">dmd</span><span class="o" style="font-weight: 600;">@</span><span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">JD</span> <span class="p">{</span> <span class="n" style="color: #333;">sd</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">s</span><span class="p"><span class="idiff left">,</span></span><span class="idiff"> </span><span class="n" style="color: #333;"><span class="idiff">ud</span></span><span class="idiff"> </span><span class="o" style="font-weight: 600;"><span class="idiff">=</span></span><span class="idiff"> </span><span class="n" style="color: #333;"><span class="idiff right">u</span></span> <span class="p">})</span> <span class="p">(</span><span class="n" style="color: #333;">lazy_fv</span> <span class="o" style="font-weight: 600;">:*:</span> <span class="n" style="color: #333;">sig_fv</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="810" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="809" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
809
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC809" class="line" lang="haskell">    <span class="n" style="color: #333;">add</span> <span class="n" style="color: #333;">uniq</span> <span class="n" style="color: #333;">dmd</span><span class="o" style="font-weight: 600;">@</span><span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">JD</span> <span class="p">{</span> <span class="n" style="color: #333;">sd</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">s</span> <span class="p">})</span> <span class="p">(</span><span class="n" style="color: #333;">lazy_fv</span> <span class="o" style="font-weight: 600;">:*:</span> <span class="n" style="color: #333;">sig_fv</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="810" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
810
</td>
<td class="diff-line-num new_line" data-linenumber="810" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
810
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC810" class="line" lang="haskell">      <span class="o" style="font-weight: 600;">|</span> <span class="kt" style="color: #458; font-weight: 600;">Lazy</span> <span class="o" style="font-weight: 600;"><-</span> <span class="n" style="color: #333;">s</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">addToUFM_Directly</span> <span class="n" style="color: #333;">lazy_fv</span> <span class="n" style="color: #333;">uniq</span> <span class="n" style="color: #333;">dmd</span> <span class="o" style="font-weight: 600;">:*:</span> <span class="n" style="color: #333;">sig_fv</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="811" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
811
</td>
<td class="diff-line-num new_line old" data-linenumber="811" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC811" class="line" lang="haskell">      <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">otherwise</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">addToUFM_Directly</span> <span class="n" style="color: #333;">lazy_fv</span> <span class="n" style="color: #333;">uniq</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">JD</span> <span class="p">{</span> <span class="n" style="color: #333;">sd</span> <span class="o" style="font-weight: 600;">=</span> <span class="kt" style="color: #458; font-weight: 600;">Lazy</span><span class="p">,</span> <span class="n" style="color: #333;">ud</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">u</span> <span class="p">})</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="812" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
812
</td>
<td class="diff-line-num new_line old" data-linenumber="811" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC812" class="line" lang="haskell">                    <span class="o" style="font-weight: 600;">:*:</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="813" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
813
</td>
<td class="diff-line-num new_line old" data-linenumber="811" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC813" class="line" lang="haskell">                    <span class="n" style="color: #333;">addToUFM_Directly</span> <span class="n" style="color: #333;">sig_fv</span>  <span class="n" style="color: #333;">uniq</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">JD</span> <span class="p">{</span> <span class="n" style="color: #333;">sd</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">s</span><span class="p">,</span>    <span class="n" style="color: #333;">ud</span> <span class="o" style="font-weight: 600;">=</span> <span class="kt" style="color: #458; font-weight: 600;">Abs</span> <span class="p">})</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="814" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="811" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
811
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC811" class="line" lang="haskell">      <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">otherwise</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">lazy_fv</span> <span class="o" style="font-weight: 600;">:*:</span> <span class="n" style="color: #333;">addToUFM_Directly</span> <span class="n" style="color: #333;">sig_fv</span>  <span class="n" style="color: #333;">uniq</span> <span class="n" style="color: #333;">dmd</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="814" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
814
</td>
<td class="diff-line-num new_line" data-linenumber="812" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
812
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC812" class="line" lang="haskell"></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="815" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
815
</td>
<td class="diff-line-num new_line" data-linenumber="813" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
813
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC813" class="line" lang="haskell"><span class="n" style="color: #333;">keepAliveDmdEnv</span> <span class="o" style="font-weight: 600;">::</span> <span class="kt" style="color: #458; font-weight: 600;">DmdEnv</span> <span class="o" style="font-weight: 600;">-></span> <span class="kt" style="color: #458; font-weight: 600;">IdSet</span> <span class="o" style="font-weight: 600;">-></span> <span class="kt" style="color: #458; font-weight: 600;">DmdEnv</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="816" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
816
</td>
<td class="diff-line-num new_line" data-linenumber="814" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
814
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC814" class="line" lang="haskell"><span class="c1" style="color: #998; font-style: italic;">-- (keepAliveDmdType dt vs) makes sure that the Ids in vs have</span></span>
</pre>
</td>
</tr>

</table>
<br>
</li>

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

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c4176ed45aa296058417ac946ce785193be24b3a">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/c4176ed45aa296058417ac946ce785193be24b3a"}}</script>


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