From bfb84d0bd6dd47f2d074c3eefb3520672217fada Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 21 Jun 2013 20:20:27 +0000 Subject: 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 --- llvm/lib/Support/BlockFrequency.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Support/BlockFrequency.cpp') 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; } -- cgit v1.2.3