Sync the __builtin_expects for our 3 quadratically probed hash table implementations.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 23 Feb 2015 16:41:36 +0000 (16:41 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 23 Feb 2015 16:41:36 +0000 (16:41 +0000)
commit42f72e2c16aa100e1316a60178c93278738f3602
treedff02a1fd8be243590c82f73c93f1558987d9641
parent01312dd0b499f0365e311b91c4c97edaef04bc97
Sync the __builtin_expects for our 3 quadratically probed hash table implementations.

This assumes that
  a) finding the bucket containing the value is LIKELY
  b) finding an empty bucket is LIKELY
  c) growing the table is UNLIKELY

I also switched the a) and b) cases for SmallPtrSet as we seem to use
the set mostly more for insertion than for checking existence.

In a simple benchmark consisting of 2^21 insertions of 2^20 unique
pointers into a DenseMap or SmallPtrSet a few percent speedup on average,
but nothing statistically significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230232 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/DenseMap.h
lib/Support/SmallPtrSet.cpp
lib/Support/StringMap.cpp