diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-10-29 17:27:39 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-10-29 17:27:39 +0000 |
commit | 09d16aa87e594afa0a8798748d13fb185cb25b31 (patch) | |
tree | 2199370b2687a60ea9446f864b926323b1bfee5a /llvm/lib/Analysis | |
parent | c59ae207ef7b79a2bbfe2f36ac7512426ef3c64e (diff) | |
download | bcm5719-llvm-09d16aa87e594afa0a8798748d13fb185cb25b31.tar.gz bcm5719-llvm-09d16aa87e594afa0a8798748d13fb185cb25b31.zip |
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!
llvm-svn: 166938
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/ProfileDataLoader.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ProfileDataLoader.cpp b/llvm/lib/Analysis/ProfileDataLoader.cpp index 69286efb3c5..a4f634af531 100644 --- a/llvm/lib/Analysis/ProfileDataLoader.cpp +++ b/llvm/lib/Analysis/ProfileDataLoader.cpp @@ -51,13 +51,7 @@ static unsigned AddCounts(unsigned A, unsigned B) { 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 @@ static void ReadProfilingArgBlock(const char *ToolName, FILE *F, } 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. |