|
From: <sv...@va...> - 2011-08-20 15:59:56
|
Author: sewardj
Date: 2011-08-20 16:55:07 +0100 (Sat, 20 Aug 2011)
New Revision: 11998
Log:
Make sure this gets built with -fomit-frame-pointer, even on x86-linux,
where it otherwise wouldn be. On x86-linux running Memcheck, gives a
6% instruction count reduction and a 10% reduction in memory traffic.
(Duh!)
Modified:
trunk/memcheck/mc_main.c
Modified: trunk/memcheck/mc_main.c
===================================================================
--- trunk/memcheck/mc_main.c 2011-08-20 11:08:48 UTC (rev 11997)
+++ trunk/memcheck/mc_main.c 2011-08-20 15:55:07 UTC (rev 11998)
@@ -49,6 +49,15 @@
#include "memcheck.h" /* for client requests */
+/* We really want this frame-pointer-less on all platforms, since the
+ helper functions are small and called very frequently. By default
+ on x86-linux, though, Makefile.all.am doesn't specify it, so do it
+ here. Requires gcc >= 4.4, unfortunately. */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# pragma GCC optimize("-fomit-frame-pointer")
+#endif
+
+
/* Set to 1 to do a little more sanity checking */
#define VG_DEBUG_MEMORY 0
@@ -1099,9 +1108,7 @@
/* --------------- Load/store slow cases. --------------- */
static
-#ifndef PERF_FAST_LOADV
-INLINE
-#endif
+__attribute__((noinline))
ULong mc_LOADVn_slow ( Addr a, SizeT nBits, Bool bigendian )
{
/* Make up a 64-bit result V word, which contains the loaded data for
@@ -1188,9 +1195,7 @@
static
-#ifndef PERF_FAST_STOREV
-INLINE
-#endif
+__attribute__((noinline))
void mc_STOREVn_slow ( Addr a, SizeT nBits, ULong vbytes, Bool bigendian )
{
SizeT szB = nBits / 8;
@@ -4204,8 +4209,8 @@
// Handle common case quickly: a is suitably aligned, is mapped, and is
// addressible.
// Convert V bits from compact memory form to expanded register form
- if (vabits8 == VA_BITS8_DEFINED ) { return V_BITS16_DEFINED; }
- else if (vabits8 == VA_BITS8_UNDEFINED) { return V_BITS16_UNDEFINED; }
+ if (LIKELY(vabits8 == VA_BITS8_DEFINED )) { return V_BITS16_DEFINED; }
+ else if (LIKELY(vabits8 == VA_BITS8_UNDEFINED)) { return V_BITS16_UNDEFINED; }
else {
// The 4 (yes, 4) bytes are not all-defined or all-undefined, check
// the two sub-bytes.
@@ -4316,8 +4321,8 @@
// Convert V bits from compact memory form to expanded register form
// Handle common case quickly: a is mapped, and the entire
// word32 it lives in is addressible.
- if (vabits8 == VA_BITS8_DEFINED ) { return V_BITS8_DEFINED; }
- else if (vabits8 == VA_BITS8_UNDEFINED) { return V_BITS8_UNDEFINED; }
+ if (LIKELY(vabits8 == VA_BITS8_DEFINED )) { return V_BITS8_DEFINED; }
+ else if (LIKELY(vabits8 == VA_BITS8_UNDEFINED)) { return V_BITS8_UNDEFINED; }
else {
// The 4 (yes, 4) bytes are not all-defined or all-undefined, check
// the single byte.
|