Force GC calls out of the straight line execution path

Harendra Kumar harendra.kumar at gmail.com
Mon Jun 13 11:23:20 UTC 2016


Hi,

I noticed in the generated code (llvm as well as native) that in some cases
the GC calls are in the straight path and the regular code is out of the
straight line path. Like this:

=> 0x408fc0:  lea    0x30(%r12),%rax
=> 0x408fc5:  cmp    0x358(%r13),%rax
=> 0x408fcc:  jbe    0x408fe9                   # notice jbe instead of ja
i.e. branch taken in normal case

I tried to count in how many cases its happening in my executable and found
that its only a small percentage (4-6%) of cases but those cases include
the code which runs 99% of the time in my benchmark. Though it does not
make a whole lot of difference but the difference is perceptible and
especially when it is in a tight loop.

Is it possible to somehow force all the GC calls out of the line during
code generation? Has it been thought/discussed before?

-harendra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160613/8f9d4ba6/attachment.html>


More information about the ghc-devs mailing list