|
From: John R. <joh...@gm...> - 2008-03-27 13:18:07
|
I'd check that the compiler is using the hint properly. I can't remember which version (somewhere from 4.0-4.1) but I found gcc would actually generate branches for the "likely" path and straight line code for the "unlikely" - completely the opposite of what it should do. In the end I actually added a gcc version check around the macros to invert the sense :) I'd check a disassembly to see if the the compiler is actually taking your hints properly. John. On 22/03/2008, Julian Seward <js...@ac...> wrote: > On Saturday 22 March 2008 09:58, Bart Van Assche wrote: > > How about the patch below ? It adds branch prediction hints to the > > expressions in assert statements. > > > Probably not worth bothering. gcc understands that paths that lead > to __attribute__((noreturn)) functions (as VG_(assert_fail) is, or > at least should be) are unlikely to be taken. So in this case the > branch prediction hints don't tell it anything it doesn't already > know. I think what you're looking at here is more in the measurement > noise level - I certainly see a lot of similar variance in run times on my > Core 2. > > > J > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |