From: Julian Seward Date: Wed, 19 Oct 2005 01:32:41 +0000 (+0000) Subject: Snap up some easy pickings pointed out by cachegrinding nulgrind on ppc32. X-Git-Tag: svn/VALGRIND_3_1_0~287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8547d43b79ad711d64b279d345bd2ec06d4a163c;p=thirdparty%2Fvalgrind.git Snap up some easy pickings pointed out by cachegrinding nulgrind on ppc32. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4945 --- diff --git a/coregrind/m_transtab.c b/coregrind/m_transtab.c index a3f165c35c..9e99da3b53 100644 --- a/coregrind/m_transtab.c +++ b/coregrind/m_transtab.c @@ -615,10 +615,20 @@ static void setFastCacheEntry ( Addr64 key, ULong* tce, UInt* count ) static void invalidateFastCache ( void ) { UInt j; - for (j = 0; j < VG_TT_FAST_SIZE; j++) { - VG_(tt_fast)[j] = &bogus_tc_entry; - VG_(tt_fastN)[j] = NULL; + /* This loop is popular enough to make it worth unrolling a + bit, at least on ppc32. */ + vg_assert(VG_TT_FAST_SIZE > 0 && (VG_TT_FAST_SIZE % 4) == 0); + for (j = 0; j < VG_TT_FAST_SIZE; j += 4) { + VG_(tt_fast)[j+0] = &bogus_tc_entry; + VG_(tt_fast)[j+1] = &bogus_tc_entry; + VG_(tt_fast)[j+2] = &bogus_tc_entry; + VG_(tt_fast)[j+3] = &bogus_tc_entry; + VG_(tt_fastN)[j+0] = NULL; + VG_(tt_fastN)[j+1] = NULL; + VG_(tt_fastN)[j+2] = NULL; + VG_(tt_fastN)[j+3] = NULL; } + vg_assert(j == VG_TT_FAST_SIZE); n_fast_flushes++; }