Improve performance of newSmallArray#
authorMichal Terepeta <michal.terepeta@gmail.com>
Sun, 24 Mar 2019 12:58:53 +0000 (13:58 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Tue, 2 Apr 2019 00:07:49 +0000 (20:07 -0400)
commit7cf5ba3dba88356571197b470556e888581212d7
tree6e89f905fe3f630ffa6684c661c374be2bfd5ff6
parent39282422afe58a0855c2fe5315163236c116c2f4
Improve performance of newSmallArray#

This:
- Hoists part of the condition outside of the initialization loop in
  `stg_newSmallArrayzh`.
- Annotates one of the unlikely branches as unlikely, also in
  `stg_newSmallArrayzh`.
- Adds a couple of annotations to `allocateMightFail` indicating which
  branches are likely to be taken.

Together this gives about 5% improvement.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>
includes/Rts.h
rts/PrimOps.cmm
rts/sm/Storage.c