diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-06-21 20:20:27 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-06-21 20:20:27 +0000 |
commit | bfb84d0bd6dd47f2d074c3eefb3520672217fada (patch) | |
tree | 07824ca5a2f687a3d1d8f29e5c18031d35ea83ec /llvm/lib/Support/BlockFrequency.cpp | |
parent | 7b7b0b9f7dc37b7c5a411cd36be56651cce2cf87 (diff) | |
download | bcm5719-llvm-bfb84d0bd6dd47f2d074c3eefb3520672217fada.tar.gz bcm5719-llvm-bfb84d0bd6dd47f2d074c3eefb3520672217fada.zip |
Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability."
This reverts commit r184584. Breaks PPC selfhost.
llvm-svn: 184590
Diffstat (limited to 'llvm/lib/Support/BlockFrequency.cpp')
-rw-r--r-- | llvm/lib/Support/BlockFrequency.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/llvm/lib/Support/BlockFrequency.cpp b/llvm/lib/Support/BlockFrequency.cpp index 53bbd8ad12d..84a993e3e5b 100644 --- a/llvm/lib/Support/BlockFrequency.cpp +++ b/llvm/lib/Support/BlockFrequency.cpp @@ -65,9 +65,6 @@ uint64_t div96bit(uint64_t W[2], uint32_t D) { BlockFrequency &BlockFrequency::operator*=(const BranchProbability &Prob) { - if (Frequency == 0) - return *this; - uint32_t n = Prob.getNumerator(); uint32_t d = Prob.getDenominator(); @@ -87,15 +84,10 @@ BlockFrequency &BlockFrequency::operator*=(const BranchProbability &Prob) { // 64-bit. mult96bit(Frequency, n, W); Frequency = div96bit(W, d); - } else { - // Fast case. - Frequency = mulRes / d; + return *this; } - // Limit the result to 1; 0 is a sentinel value. This keeps BlockFrequencyInfo - // from getting stuck at zero frequencies just because a value became too - // small to be represented as a BlockFrequency. - Frequency = (n == 0 || Frequency != 0) ? Frequency : 1; + Frequency = mulRes / d; return *this; } |