]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Speed up the --cache-sim=no case.
authorNicholas Nethercote <njn@valgrind.org>
Mon, 27 Sep 2010 02:20:38 +0000 (02:20 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Mon, 27 Sep 2010 02:20:38 +0000 (02:20 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11383

cachegrind/cg_main.c

index 690d5d0da5284b0e55b62a1f9acb29783eec7f37..84341d477e74daf01fb96f493a05b85547f7a772 100644 (file)
@@ -289,6 +289,30 @@ static LineCC* get_lineCC(Addr origAddr)
 /*--- Cache simulation functions                           ---*/
 /*------------------------------------------------------------*/
 
+// Only used with --cache-sim=no.
+static VG_REGPARM(1)
+void log_1I(InstrInfo* n)
+{
+   n->parent->Ir.a++;
+}
+
+// Only used with --cache-sim=no.
+static VG_REGPARM(2)
+void log_2I(InstrInfo* n, InstrInfo* n2)
+{
+   n->parent->Ir.a++;
+   n2->parent->Ir.a++;
+}
+
+// Only used with --cache-sim=no.
+static VG_REGPARM(3)
+void log_3I(InstrInfo* n, InstrInfo* n2, InstrInfo* n3)
+{
+   n->parent->Ir.a++;
+   n2->parent->Ir.a++;
+   n3->parent->Ir.a++;
+}
+
 static VG_REGPARM(1)
 void log_1I_0D_cache_access(InstrInfo* n)
 {
@@ -708,8 +732,13 @@ static void flushEvents ( CgState* cgs )
             else
             if (ev2 && ev3 && ev2->tag == Ev_Ir && ev3->tag == Ev_Ir)
             {
-               helperName = "log_3I_0D_cache_access";
-               helperAddr = &log_3I_0D_cache_access;
+               if (clo_cache_sim) {
+                  helperName = "log_3I_0D_cache_access";
+                  helperAddr = &log_3I_0D_cache_access;
+               } else {
+                  helperName = "log_3I";
+                  helperAddr = &log_3I;
+               }
                argv = mkIRExprVec_3( i_node_expr, 
                                      mkIRExpr_HWord( (HWord)ev2->inode ), 
                                      mkIRExpr_HWord( (HWord)ev3->inode ) );
@@ -719,8 +748,13 @@ static void flushEvents ( CgState* cgs )
             /* Merge an Ir with one following Ir. */
             else
             if (ev2 && ev2->tag == Ev_Ir) {
-               helperName = "log_2I_0D_cache_access";
-               helperAddr = &log_2I_0D_cache_access;
+               if (clo_cache_sim) {
+                  helperName = "log_2I_0D_cache_access";
+                  helperAddr = &log_2I_0D_cache_access;
+               } else {
+                  helperName = "log_2I";
+                  helperAddr = &log_2I;
+               }
                argv = mkIRExprVec_2( i_node_expr,
                                      mkIRExpr_HWord( (HWord)ev2->inode ) );
                regparms = 2;
@@ -728,8 +762,13 @@ static void flushEvents ( CgState* cgs )
             }
             /* No merging possible; emit as-is. */
             else {
-               helperName = "log_1I_0D_cache_access";
-               helperAddr = &log_1I_0D_cache_access;
+               if (clo_cache_sim) {
+                  helperName = "log_1I_0D_cache_access";
+                  helperAddr = &log_1I_0D_cache_access;
+               } else {
+                  helperName = "log_1I";
+                  helperAddr = &log_1I;
+               }
                argv = mkIRExprVec_1( i_node_expr );
                regparms = 1;
                i++;