1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/lib
Chandler Carruth cc9b4516cb Rewrite LLVM's generalized support library for hashing to follow the API
of the proposed standard hashing interfaces (N3333), and to use
a modified and tuned version of the CityHash algorithm.

Some of the highlights of this change:
 -- Significantly higher quality hashing algorithm with very well
    distributed results, and extremely few collisions. Should be close to
    a checksum for up to 64-bit keys. Very little clustering or clumping of
    hash codes, to better distribute load on probed hash tables.
 -- Built-in support for reserved values.
 -- Simplified API that composes cleanly with other C++ idioms and APIs.
 -- Better scaling performance as keys grow. This is the fastest
    algorithm I've found and measured for moderately sized keys (such as
    show up in some of the uniquing and folding use cases)
 -- Support for enabling per-execution seeds to prevent table ordering
    or other artifacts of hashing algorithms to impact the output of
    LLVM. The seeding would make each run different and highlight these
    problems during bootstrap.

This implementation was tested extensively using the SMHasher test
suite, and pased with flying colors, doing better than the original
CityHash algorithm even.

I've included a unittest, although it is somewhat minimal at the moment.
I've also added (or refactored into the proper location) type traits
necessary to implement this, and converted users of GeneralHash over.

My only immediate concerns with this implementation is the performance
of hashing small keys. I've already started working to improve this, and
will continue to do so. Currently, the only algorithms faster produce
lower quality results, but it is likely there is a better compromise
than the current one.

Many thanks to Jeffrey Yasskin who did most of the work on the N3333
paper, pair-programmed some of this code, and reviewed much of it. Many
thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original
authors of CityHash on which this is heavily based, and Austin Appleby
who created MurmurHash and the SMHasher test suite.

Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for
all of the review comments! If there are further comments or concerns,
please let me know and I'll jump on 'em.

llvm-svn: 151822
2012-03-01 18:55:25 +00:00
..
Analysis Duncan pointed out that if the alignment isn't explicitly specified, it defaults to the ABI alignment. Given that, make this code a bit more aggressive in such cases. 2012-02-27 23:16:46 +00:00
Archive
AsmParser Convert assert(0) to llvm_unreachable 2012-02-07 05:05:23 +00:00
Bitcode BitstreamWriter: Change primary output buffer to be a SmallVector instead of an 2012-02-29 20:31:09 +00:00
CodeGen Fix a codegen fault in which log2 or exp2 could be dead-code eliminated even though they could have sideeffects. 2012-03-01 14:32:18 +00:00
DebugInfo
ExecutionEngine Fixed the 32-bit runtime dynamic loader to allocate 2012-03-01 00:15:29 +00:00
Linker Oops...Don't commit the other stuff.. 2012-02-28 04:01:21 +00:00
MC Make MemoryObject accessor members const again 2012-02-29 01:09:06 +00:00
Object [Object] 2012-03-01 01:36:50 +00:00
Support Rewrite LLVM's generalized support library for hashing to follow the API 2012-03-01 18:55:25 +00:00
TableGen Remove stray semi-colon. 2012-02-28 15:35:52 +00:00
Target Make TargetRegisterClasses non-virtual by making the only virtual function a function pointer. 2012-03-01 13:37:55 +00:00
Transforms Have GVN also do condition propagation when the right-hand side is not 2012-02-29 11:12:03 +00:00
VMCore Rewrite LLVM's generalized support library for hashing to follow the API 2012-03-01 18:55:25 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile