[llvm-commits] [llvm] r166938 - in /llvm/trunk: include/llvm/Analysis/ProfileDataLoader.h lib/Analysis/ProfileDataLoader.cpp

Bob Wilson bob.wilson at apple.com
Mon Oct 29 10:27:39 PDT 2012


Author: bwilson
Date: Mon Oct 29 12:27:39 2012
New Revision: 166938

URL: http://llvm.org/viewvc/llvm-project?rev=166938&view=rev
Log:
Remove code to saturate profile counts.

We may need to change the way profile counter values are stored, but
saturation is the wrong thing to do.  Just remove it for now.

Patch by Alastair Murray!

Modified:
    llvm/trunk/include/llvm/Analysis/ProfileDataLoader.h
    llvm/trunk/lib/Analysis/ProfileDataLoader.cpp

Modified: llvm/trunk/include/llvm/Analysis/ProfileDataLoader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ProfileDataLoader.h?rev=166938&r1=166937&r2=166938&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ProfileDataLoader.h (original)
+++ llvm/trunk/include/llvm/Analysis/ProfileDataLoader.h Mon Oct 29 12:27:39 2012
@@ -115,9 +115,6 @@
   /// been counted yet.
   static const unsigned Uncounted;
 
-  /// The maximum value that can be stored in a profiling counter.
-  static const unsigned MaxCount;
-
   /// getNumExecutions - Return the number of times the target program was run
   /// to generate this profiling data.
   unsigned getNumExecutions() const { return CommandLines.size(); }

Modified: llvm/trunk/lib/Analysis/ProfileDataLoader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileDataLoader.cpp?rev=166938&r1=166937&r2=166938&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ProfileDataLoader.cpp (original)
+++ llvm/trunk/lib/Analysis/ProfileDataLoader.cpp Mon Oct 29 12:27:39 2012
@@ -51,13 +51,7 @@
   if (A == ProfileDataLoader::Uncounted) return B;
   if (B == ProfileDataLoader::Uncounted) return A;
 
-  // Saturate to the maximum storable value.  This could change taken/nottaken
-  // ratios, but is presumably better than wrapping and thus potentially
-  // inverting ratios.
-  uint64_t tmp = (uint64_t)A + (uint64_t)B;
-  if (tmp > (uint64_t)ProfileDataLoader::MaxCount)
-    tmp = ProfileDataLoader::MaxCount;
-  return (unsigned)tmp;
+  return A + B;
 }
 
 /// ReadProfilingData - Load 'NumEntries' items of type 'T' from file 'F'
@@ -120,7 +114,6 @@
 }
 
 const unsigned ProfileDataLoader::Uncounted = ~0U;
-const unsigned ProfileDataLoader::MaxCount = ~0U - 1U;
 
 /// ProfileDataLoader ctor - Read the specified profiling data file, reporting
 /// a fatal error if the file is invalid or broken.





More information about the llvm-commits mailing list