Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
diff --git a/lib/Support/BlockFrequency.cpp b/lib/Support/BlockFrequency.cpp
index 00efe90..00cf75b 100644
--- a/lib/Support/BlockFrequency.cpp
+++ b/lib/Support/BlockFrequency.cpp
@@ -145,28 +145,19 @@
return Freq;
}
+BlockFrequency &BlockFrequency::operator>>=(const unsigned count) {
+ // Frequency can never be 0 by design.
+ assert(Frequency != 0);
+
+ // Shift right by count.
+ Frequency >>= count;
+
+ // Saturate to 1 if we are 0.
+ Frequency |= Frequency == 0;
+ return *this;
+}
+
uint32_t BlockFrequency::scale(const BranchProbability &Prob) {
return scale(Prob.getNumerator(), Prob.getDenominator());
}
-void BlockFrequency::print(raw_ostream &OS) const {
- // Convert fixed-point number to decimal.
- OS << Frequency / getEntryFrequency() << ".";
- uint64_t Rem = Frequency % getEntryFrequency();
- uint64_t Eps = 1;
- do {
- Rem *= 10;
- Eps *= 10;
- OS << Rem / getEntryFrequency();
- Rem = Rem % getEntryFrequency();
- } while (Rem >= Eps/2);
-}
-
-namespace llvm {
-
-raw_ostream &operator<<(raw_ostream &OS, const BlockFrequency &Freq) {
- Freq.print(OS);
- return OS;
-}
-
-}