<!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=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>



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

<h3>
 Marge Bot pushed to branch master
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/eb2a4df84cd7d66bb27f8ccb08ef10d5c984e892">eb2a4df8</a></strong>
<div>
<span>by Michal Terepeta</span>
<i>at 2019-04-20T03:32:08Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">StgCmmPrim: remove an unnecessary instruction in doNewArrayOp

Previously we would generate a local variable pointing after the array
header and use it to initialize the array elements. But we already use
stores with offset, so it's easy to just add the header to those offsets
during compilation and avoid generating the local variable (which would
become a LEA instruction when using native codegen; LLVM already
optimizes it away).

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class="file-stats">
<a href="#731b07c16b2f4bb31dd7defa4ceef54e74473cc7">
compiler/codeGen/StgCmmPrim.hs
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="731b07c16b2f4bb31dd7defa4ceef54e74473cc7">
<a href="https://gitlab.haskell.org/ghc/ghc/commit/eb2a4df84cd7d66bb27f8ccb08ef10d5c984e892#731b07c16b2f4bb31dd7defa4ceef54e74473cc7"><strong>compiler/codeGen/StgCmmPrim.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="2143" 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="2143" 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">@@ -2143,11 +2143,8 @@ doNewArrayOp res_r rep info payload n init = do</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="2143" 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">
2143
</td>
<td class="diff-line-num new_line" data-linenumber="2143" 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">
2143
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC2143" class="line" lang="haskell">    <span class="n" style="color: #333;">emit</span> <span class="o" style="font-weight: 600;">$</span> <span class="n" style="color: #333;">mkAssign</span> <span class="n" style="color: #333;">arr</span> <span class="n" style="color: #333;">base</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="2144" 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">
2144
</td>
<td class="diff-line-num new_line" data-linenumber="2144" 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">
2144
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC2144" 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="2145" 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">
2145
</td>
<td class="diff-line-num new_line" data-linenumber="2145" 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">
2145
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC2145" class="line" lang="haskell">    <span class="c1" style="color: #998; font-style: italic;">-- Initialise all elements of the array</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="2146" 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">
2146
</td>
<td class="diff-line-num new_line old" data-linenumber="2146" 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 noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC2146" class="line" lang="haskell">    <span class="n" style="color: #333;">p</span> <span class="o" style="font-weight: 600;"><-</span> <span class="n" style="color: #333;">assignTemp</span> <span class="o" style="font-weight: 600;">$</span> <span class="n" style="color: #333;">cmmOffsetB</span> <span class="n" style="color: #333;">dflags</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">CmmReg</span> <span class="n" style="color: #333;">arr</span><span class="p">)</span> <span class="p">(</span><span class="n" style="color: #333;">hdrSize</span> <span class="n" style="color: #333;">dflags</span> <span class="n" style="color: #333;">rep</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="2147" 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">
2147
</td>
<td class="diff-line-num new_line old" data-linenumber="2146" 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 noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC2147" class="line" lang="haskell">    <span class="kr" style="font-weight: 600;">let</span> <span class="n" style="color: #333;">initialization</span> <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="2148" 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">
2148
</td>
<td class="diff-line-num new_line old" data-linenumber="2146" 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 noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC2148" class="line" lang="haskell">            <span class="p">[</span> <span class="n" style="color: #333;">mkStore</span> <span class="p">(</span><span class="n" style="color: #333;">cmmOffsetW</span> <span class="n" style="color: #333;">dflags</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">CmmReg</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">CmmLocal</span> <span class="n" style="color: #333;">p</span><span class="p">))</span> <span class="n" style="color: #333;">off</span><span class="p">)</span> <span class="n" style="color: #333;">init</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="2149" 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">
2149
</td>
<td class="diff-line-num new_line old" data-linenumber="2146" 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 noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC2149" class="line" lang="haskell">            <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">off</span> <span class="o" style="font-weight: 600;"><-</span> <span class="p">[</span><span class="mi" style="color: #099;">0</span><span class="o" style="font-weight: 600;">..</span> <span class="n" style="color: #333;">n</span> <span class="o" style="font-weight: 600;">-</span> <span class="mi" style="color: #099;">1</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="2150" 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">
2150
</td>
<td class="diff-line-num new_line old" data-linenumber="2146" 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 noteable_line old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC2150" class="line" lang="haskell">            <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="2151" 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="2146" 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">
2146
</td>
<td class="line_content new noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC2146" class="line" lang="haskell">    <span class="kr" style="font-weight: 600;">let</span> <span class="n" style="color: #333;">mkOff</span> <span class="n" style="color: #333;">off</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">cmmOffsetW</span> <span class="n" style="color: #333;">dflags</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">CmmReg</span> <span class="n" style="color: #333;">arr</span><span class="p">)</span> <span class="p">(</span><span class="n" style="color: #333;">hdrSizeW</span> <span class="n" style="color: #333;">dflags</span> <span class="n" style="color: #333;">rep</span> <span class="o" style="font-weight: 600;">+</span> <span class="n" style="color: #333;">off</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="2151" 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="2147" 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">
2147
</td>
<td class="line_content new noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC2147" class="line" lang="haskell">        <span class="n" style="color: #333;">initialization</span> <span class="o" style="font-weight: 600;">=</span> <span class="p">[</span> <span class="n" style="color: #333;">mkStore</span> <span class="p">(</span><span class="n" style="color: #333;">mkOff</span> <span class="n" style="color: #333;">off</span><span class="p">)</span> <span class="n" style="color: #333;">init</span> <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">off</span> <span class="o" style="font-weight: 600;"><-</span> <span class="p">[</span><span class="mi" style="color: #099;">0</span><span class="o" style="font-weight: 600;">..</span> <span class="n" style="color: #333;">n</span> <span class="o" style="font-weight: 600;">-</span> <span class="mi" style="color: #099;">1</span><span class="p">]</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="2151" 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">
2151
</td>
<td class="diff-line-num new_line" data-linenumber="2148" 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">
2148
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC2148" class="line" lang="haskell">    <span class="n" style="color: #333;">emit</span> <span class="p">(</span><span class="n" style="color: #333;">catAGraphs</span> <span class="n" style="color: #333;">initialization</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="2152" 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">
2152
</td>
<td class="diff-line-num new_line" data-linenumber="2149" 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">
2149
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC2149" 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="2153" 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">
2153
</td>
<td class="diff-line-num new_line" data-linenumber="2150" 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">
2150
</td>
<td class="line_content noteable_line" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC2150" class="line" lang="haskell">    <span class="n" style="color: #333;">emit</span> <span class="o" style="font-weight: 600;">$</span> <span class="n" style="color: #333;">mkAssign</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">CmmLocal</span> <span class="n" style="color: #333;">res_r</span><span class="p">)</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">CmmReg</span> <span class="n" style="color: #333;">arr</span><span class="p">)</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/eb2a4df84cd7d66bb27f8ccb08ef10d5c984e892">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/eb2a4df84cd7d66bb27f8ccb08ef10d5c984e892"}}</script>

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