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 | b47aceaf068352eebf4da87a647363b2317f0f22 (patch) | |
| tree | 6cc2aa330ff430513341f69bbd2841f935c4c4fa /lib/Support | |
| parent | 5a18572320542a66778f20fb624310fe7662cc85 (diff) | |
| download | external_llvm-b47aceaf068352eebf4da87a647363b2317f0f22.zip external_llvm-b47aceaf068352eebf4da87a647363b2317f0f22.tar.gz external_llvm-b47aceaf068352eebf4da87a647363b2317f0f22.tar.bz2 | |
Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability."
This reverts commit r184584. Breaks PPC selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
| -rw-r--r-- | lib/Support/BlockFrequency.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/Support/BlockFrequency.cpp b/lib/Support/BlockFrequency.cpp index 53bbd8a..84a993e 100644 --- a/lib/Support/BlockFrequency.cpp +++ b/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; } |
