Change the TT_FAST hash function for from "insn_address >> 2" to
"insn_address >> 1".  The former is appropriate for ARM code, where
all insns are 4-sized and 4-aligned, but not for Thumb code, where the
minimum size and alignment is 2.  The old scheme happened to work for
Thumb (indeed, any hash function would), but caused huge amounts of
conflict misses in the fast cache for some programs.

The change has been observed to reduce conflict misses by up to 100
times, and in some cases, improves performance significantly for Thumb
code.  Performance of ARM code is unchanged or possibly a bit worse.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11716 a5019735-40e9-0310-863c-91ae7b9d1cf9
2 files changed