]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Inline cachesim_*_doref(). This gains about 5--10% in speed.
authorNicholas Nethercote <njn@valgrind.org>
Sun, 13 Nov 2005 17:57:32 +0000 (17:57 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 13 Nov 2005 17:57:32 +0000 (17:57 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5117

cachegrind/cg_sim.c

index 7cab553cb2f5500785b20a4af570835be73141e5..fe3ac93439d233d595c48dedf6b3d5fb7c7449ed 100644 (file)
@@ -108,7 +108,10 @@ static void cachesim_##L##_initcache(cache_t config)                        \
     cachesim_initcache(config, &L);                                         \
 }                                                                           \
                                                                             \
-static /* __inline__ */                                                     \
+/* This attribute forces GCC to inline this function, even though it's */   \
+/* bigger than its usual limit.  Inlining gains around 5--10% speedup. */   \
+__attribute__((always_inline))                                              \
+static __inline__                                                           \
 void cachesim_##L##_doref(Addr a, UChar size, ULong* m1, ULong *m2)         \
 {                                                                           \
    register UInt  set1 = ( a         >> L.line_size_bits) & (L.sets_min_1); \