Update after lookup in map.increment for HASH types
authorBrenden Blanco <bblanco@gmail.com>
Wed, 23 Aug 2017 22:15:32 +0000 (15:15 -0700)
committerBrenden Blanco <bblanco@gmail.com>
Fri, 25 Aug 2017 23:43:01 +0000 (16:43 -0700)
commit23fc58904455047ac2bbdb44b26839e127bf7fcb
treeb79f44c9296a93624fc8a6fa87cad92587360190
parent917f4c76db4391bb2ef955b6bf659857e8a35f8d
Update after lookup in map.increment for HASH types

Performing the update before lookup incurs an extra spinlock in the
kernel, which hurts performance. Reorder the code and increment to 1.
The memset is there I believe due to some type mismatch warnings, so I'm
leaving as is rather than doing a direct assign to 1. The resulting code
is optimized away anyway.

Fixes: #1314
Signed-off-by: Brenden Blanco <bblanco@gmail.com>
src/cc/frontends/clang/b_frontend_action.cc