[LLVMdev] [PATCH] FoldingSetNodeID: use MurmurHash2 instead of SuperFastHash

Gregory Petrosyan gregory.petrosyan at gmail.com
Mon Feb 8 11:27:38 PST 2010


On Mon, Feb 08, 2010 at 08:15:49PM +0200, Török Edwin wrote:
> +/// This version additionally assumes that 'len % 4 == 0'. Below are the
> +/// original notes.
> +///
> +/// Note - This code makes a few assumptions about how your machine
> behaves -
> +///
> +/// 1. We can read a 4-byte value from any address without crashing
> 
> Doesn't it only need the start of the data to be 4-byte aligned?
> That seems to be the case already, since this is a smallvector of unsigned.
> 
> +/// 2. sizeof(int) == 4
> 
> How about using uint32_t/int32_t instead of int then?

You are right in both cases -- these are notes (and source) from the original
implementation, I decided to leave them as-is for easier verification of the
hashing algorithm.

	Gregory



More information about the llvm-dev mailing list