<div dir="ltr">Hi Ömer,<br><div><br></div><div>I just checked and I do not see this behavior in 8.0.1 native code, it is only seen in 7.10.3. So I guess this got fixed in 8.0.</div><div><br></div><div>How about the llvm generated code? Can we control this behavior for llvm generated code as well? I first noticed this in llvm generated code with ghc-7.10.3. I do not yet have llvm-3.7 installed to verify the same on 8.0.1.</div><div><br></div><div>-harendra</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 June 2016 at 18:04, Ömer Sinan Ağacan <span dir="ltr"><<a href="mailto:omeragacan@gmail.com" target="_blank">omeragacan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Harendra,<br>
<br>
Would it be possible for you to provide a minimal example that compiles to such<br>
assembly? It's hard to tell if this is an easy case.<br>
<br>
Also, just to make sure, you're using -O, right? (I'm not sure if we have a<br>
related transformation enabled with -O but just to make sure...)<br>
<div><div class="h5"><br>
2016-06-13 7:23 GMT-04:00 Harendra Kumar <<a href="mailto:harendra.kumar@gmail.com">harendra.kumar@gmail.com</a>>:<br>
> Hi,<br>
><br>
> I noticed in the generated code (llvm as well as native) that in some cases<br>
> the GC calls are in the straight path and the regular code is out of the<br>
> straight line path. Like this:<br>
><br>
> => 0x408fc0: lea 0x30(%r12),%rax<br>
> => 0x408fc5: cmp 0x358(%r13),%rax<br>
> => 0x408fcc: jbe 0x408fe9 # notice jbe instead of ja<br>
> i.e. branch taken in normal case<br>
><br>
> I tried to count in how many cases its happening in my executable and found<br>
> that its only a small percentage (4-6%) of cases but those cases include the<br>
> code which runs 99% of the time in my benchmark. Though it does not make a<br>
> whole lot of difference but the difference is perceptible and especially<br>
> when it is in a tight loop.<br>
><br>
> Is it possible to somehow force all the GC calls out of the line during code<br>
> generation? Has it been thought/discussed before?<br>
><br>
> -harendra<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
><br>
</blockquote></div><br></div>