mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[block-freq] Remove old BlockFrequency entry frequency and printing code.
llvm-svn: 197297
This commit is contained in:
parent
d274826780
commit
48849e11df
@ -25,7 +25,6 @@ class BranchProbability;
|
|||||||
class BlockFrequency {
|
class BlockFrequency {
|
||||||
|
|
||||||
uint64_t Frequency;
|
uint64_t Frequency;
|
||||||
static const int64_t ENTRY_FREQ = 1 << 14;
|
|
||||||
|
|
||||||
/// \brief Scale the given BlockFrequency by N/D. Return the remainder from
|
/// \brief Scale the given BlockFrequency by N/D. Return the remainder from
|
||||||
/// the division by D. Upon overflow, the routine will saturate and
|
/// the division by D. Upon overflow, the routine will saturate and
|
||||||
@ -35,9 +34,6 @@ class BlockFrequency {
|
|||||||
public:
|
public:
|
||||||
BlockFrequency(uint64_t Freq = 0) : Frequency(Freq) { }
|
BlockFrequency(uint64_t Freq = 0) : Frequency(Freq) { }
|
||||||
|
|
||||||
/// \brief Returns the frequency of the entry block of the function.
|
|
||||||
static uint64_t getEntryFrequency() { return ENTRY_FREQ; }
|
|
||||||
|
|
||||||
/// \brief Returns the maximum possible frequency, the saturation value.
|
/// \brief Returns the maximum possible frequency, the saturation value.
|
||||||
static uint64_t getMaxFrequency() { return -1ULL; }
|
static uint64_t getMaxFrequency() { return -1ULL; }
|
||||||
|
|
||||||
@ -78,12 +74,8 @@ public:
|
|||||||
bool operator>=(const BlockFrequency &RHS) const {
|
bool operator>=(const BlockFrequency &RHS) const {
|
||||||
return Frequency >= RHS.Frequency;
|
return Frequency >= RHS.Frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print(raw_ostream &OS) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
raw_ostream &operator<<(raw_ostream &OS, const BlockFrequency &Freq);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -149,24 +149,3 @@ uint32_t BlockFrequency::scale(const BranchProbability &Prob) {
|
|||||||
return scale(Prob.getNumerator(), Prob.getDenominator());
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user