Blame SOURCES/valgrind-3.9.0-cachegrind-improvements.patch

aa821a
--- valgrind-3.8.1/cachegrind/cg_sim.c.jj	2011-10-26 23:24:32.000000000 +0200
aa821a
+++ valgrind-3.8.1/cachegrind/cg_sim.c	2011-12-09 17:31:19.256023683 +0100
aa821a
@@ -42,27 +42,30 @@ typedef struct {
aa821a
    Int          size;                   /* bytes */
aa821a
    Int          assoc;
aa821a
    Int          line_size;              /* bytes */
aa821a
-   Int          sets;
aa821a
    Int          sets_min_1;
aa821a
    Int          line_size_bits;
aa821a
    Int          tag_shift;
aa821a
-   HChar        desc_line[128];         /* large enough */
aa821a
    UWord*       tags;
aa821a
-} cache_t2;
aa821a
+   HChar        desc_line[128];
aa821a
+} cache_t2
aa821a
+#ifdef __GNUC__
aa821a
+__attribute__ ((aligned (8 * sizeof (Int))))
aa821a
+#endif
aa821a
+;
aa821a
 
aa821a
 /* By this point, the size/assoc/line_size has been checked. */
aa821a
 static void cachesim_initcache(cache_t config, cache_t2* c)
aa821a
 {
aa821a
-   Int i;
aa821a
+   Int sets;
aa821a
 
aa821a
    c->size      = config.size;
aa821a
    c->assoc     = config.assoc;
aa821a
    c->line_size = config.line_size;
aa821a
 
aa821a
-   c->sets           = (c->size / c->line_size) / c->assoc;
aa821a
-   c->sets_min_1     = c->sets - 1;
aa821a
+   sets              = (c->size / c->line_size) / c->assoc;
aa821a
+   c->sets_min_1     = sets - 1;
aa821a
    c->line_size_bits = VG_(log2)(c->line_size);
aa821a
-   c->tag_shift      = c->line_size_bits + VG_(log2)(c->sets);
aa821a
+   c->tag_shift      = c->line_size_bits + VG_(log2)(sets);
aa821a
 
aa821a
    if (c->assoc == 1) {
aa821a
       VG_(sprintf)(c->desc_line, "%d B, %d B, direct-mapped", 
aa821a
@@ -72,11 +75,8 @@ static void cachesim_initcache(cache_t c
aa821a
                                  c->size, c->line_size, c->assoc);
aa821a
    }
aa821a
 
aa821a
-   c->tags = VG_(malloc)("cg.sim.ci.1",
aa821a
-                         sizeof(UWord) * c->sets * c->assoc);
aa821a
-
aa821a
-   for (i = 0; i < c->sets * c->assoc; i++)
aa821a
-      c->tags[i] = 0;
aa821a
+   c->tags = VG_(calloc)("cg.sim.ci.1",
aa821a
+                         sizeof(UWord), sets * c->assoc);
aa821a
 }
aa821a
 
aa821a
 /* This attribute forces GCC to inline the function, getting rid of a