]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Eliminated out-of-line copy of vc_lte().
authorBart Van Assche <bvanassche@acm.org>
Sun, 22 Jun 2008 13:05:00 +0000 (13:05 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 22 Jun 2008 13:05:00 +0000 (13:05 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8268

exp-drd/drd_vc.c
exp-drd/drd_vc.h
exp-drd/scripts/run-splash2

index cefc3fa0c6e300d38ccac830384dcab81975af99..b083974d718cdd5d8113c631018b19cde196aeaf 100644 (file)
@@ -99,30 +99,6 @@ void vc_increment(VectorClock* const vc, ThreadId const threadid)
   }
 }
 
-/**
- * @return True if all thread id's that are present in vc1 also exist in
- *    vc2, and if additionally all corresponding counters in v2 are higher or
- *    equal.
- */
-Bool vc_lte(const VectorClock* const vc1, const VectorClock* const vc2)
-{
-  unsigned i;
-  unsigned j = 0;
-  for (i = 0; i < vc1->size; i++)
-  {
-    while (j < vc2->size && vc2->vc[j].threadid < vc1->vc[i].threadid)
-    {
-      j++;
-    }
-    if (j >= vc2->size || vc2->vc[j].threadid > vc1->vc[i].threadid)
-      return False;
-    //tl_assert(j < vc2->size && vc2->vc[j].threadid == vc1->vc[i].threadid);
-    if (vc1->vc[i].count > vc2->vc[j].count)
-      return False;
-  }
-  return True;
-}
-
 /**
  * @return True if vector clocks vc1 and vc2 are ordered, and false otherwise.
  * Order is as imposed by thread synchronization actions ("happens before").
index 3737880bf1265824f1a43d514034d07682124b5f..93ead91c947c63a5d2ca352eeb8a922afd915906 100644 (file)
@@ -71,6 +71,7 @@ void vc_assign(VectorClock* const lhs,
                const VectorClock* const rhs);
 UInt vc_get(VectorClock* const vc, const ThreadId tid);
 void vc_increment(VectorClock* const vc, ThreadId const threadid);
+static __inline__
 Bool vc_lte(const VectorClock* const vc1,
             const VectorClock* const vc2);
 Bool vc_ordered(const VectorClock* const vc1,
@@ -89,4 +90,36 @@ void vc_check(const VectorClock* const vc);
 void vc_test(void);
 
 
+
+/**
+ * @return True if all thread id's that are present in vc1 also exist in
+ *    vc2, and if additionally all corresponding counters in v2 are higher or
+ *    equal.
+ */
+static __inline__
+Bool vc_lte(const VectorClock* const vc1, const VectorClock* const vc2)
+{
+  unsigned i;
+  unsigned j = 0;
+
+  for (i = 0; i < vc1->size; i++)
+  {
+    while (j < vc2->size && vc2->vc[j].threadid < vc1->vc[i].threadid)
+    {
+      j++;
+    }
+    if (j >= vc2->size || vc2->vc[j].threadid > vc1->vc[i].threadid)
+      return False;
+#ifdef ENABLE_DRD_CONSISTENCY_CHECKS
+    /* This assert statement has been commented out because of performance */
+    /* reasons.*/
+    tl_assert(j < vc2->size && vc2->vc[j].threadid == vc1->vc[i].threadid);
+#endif
+    if (vc1->vc[i].count > vc2->vc[j].count)
+      return False;
+  }
+  return True;
+}
+
+
 #endif /* __DRD_VC_H */
index dd8ddb2c931fcb20ac72207665209ca501bab650..32fc51cb23b8e8b30e4f966fc13c039eff4b23fa 100755 (executable)
@@ -145,20 +145,20 @@ fi
 # Results:                native       native       native       none     none       DRD       DRD      HG        ITC ITC
 #                         -p1          -p2          -p4           -p1      -p4       -p4      -p4+f     -p4     -p4 -p4+f
 # .......................................................................................................................
-# Cholesky                0.22  45672  0.15  55765  1.02 140203 9.05 2.31  4.5 0.96   20 1.12  15 1.18    7  1.76 239  82
-# FFT                     0.10  23776  0.07  75683  0.07 113920 9.10 3.48 13.4 0.94   88 1.30  64 1.37  373  1.75  90  41
-# LU, contiguous          0.57  16584  0.39  24784  0.36  41192 7.81 4.56 13.8 2.44   81 3.11  81 3.31  162  4.63 428 128
-# LU, non-contiguous      0.65  16592  0.34  24784  0.36  41176 6.83 4.55 12.5 2.44  136 3.31 127 3.51  111  4.53 428 128
-# Ocean, contiguous      14.39 917504  9.68 927232  9.65 945664 2.36 1.06  3.6 1.06   60 1.93  46 1.94   88  1.89  90  28
-# Ocean, non-contiguous   0.20  31944  0.16  40144  0.12  56552 4.40 2.85  7.8 2.05   43 2.48  53 2.65   98  3.74  90  28
+# Cholesky                0.21  45672  0.15  55765  1.02 140203 9.05 2.31  4.5 0.96   20 1.12  15 1.18    7  1.76 239  82
+# FFT                     0.11  23776  0.07  75683  0.07 113920 8.36 3.48 13.1 0.94   86 1.30  64 1.37  371  1.75  90  41
+# LU, contiguous          0.58  16584  0.38  24784  0.36  41192 7.72 4.56 12.7 2.44   81 3.11  80 3.31  163  4.63 428 128
+# LU, non-contiguous      0.64  16592  0.34  24784  0.36  41176 7.59 4.55 12.7 2.44  134 3.31 124 3.51  111  4.53 428 128
+# Ocean, contiguous      14.37 917504  9.60 927232  9.61 945664 2.38 1.06  3.6 1.06   61 1.93  47 1.94   89  1.89  90  28
+# Ocean, non-contiguous   0.20  31944  0.12  40144  0.14  56552 4.40 2.85  6.7 2.05   37 2.48  45 2.63   84  3.74  90  28
 # Radiosity               2.33  .....  2.32  .....  2.33  ..... .... .... .... ....  175 ....  61 ....   60  .... 485 163
-# Radix                   2.79 279488  1.46 287744  1.48 304256 6.19 1.21 11.7 1.19   30 1.93  28 1.96  127  2.13 222  56
-# Raytrace                1.67 320064  0.87 393792  0.87 366485 7.87 1.18 14.1 1.10 1267 1.27 171 1.28  219  1.97 172  53
-# Water-n2                0.16  17104  0.07  33480  0.08  66240 8.38 4.50 17.4 1.91 1967 2.97 534 3.01  106  3.48 189  39
-# Water-sp                0.13  10784  0.06  84352  0.06 144448 10.2 6.47 23.0 0.65  258 0.77  92 0.83  129  1.21 183  34
+# Radix                   2.80 279488  1.46 287744  1.47 304256 6.17 1.21 11.8 1.19   30 1.93  28 1.96  212  2.13 222  56
+# Raytrace                1.68 320064  0.87 328256  0.87 388330 7.29 1.18 14.9 1.04 1290 1.19 169 1.21  219  1.86 172  53
+# Water-n2                0.16  17104  0.07  33480  0.08  66240 8.62 4.50 17.8 1.91 1869 2.94 449 3.01  106  3.48 189  39
+# Water-sp                0.13  10784  0.07  84352  0.06 144448 10.1 6.47 22.5 0.65  258 0.77  91 0.83  129  1.21 183  34
 # .......................................................................................................................
 # Hardware: dual-core Intel Core2 Duo E6750, 2.66 GHz, 4 MB L2 cache, 2 GB RAM.
-# Software: openSUSE 11.0, 64-bit, gcc 4.3.1, runlevel 5, X screensaver: blank.
+# Software: openSUSE 11.0, 64-bit, gcc 4.3.1, runlevel 3.
 #########################################################################################################################
 
 cache_size=$(get_cache_size)