mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-29 16:12:44 +00:00
Print branch probabilities as percentages.
50% is much more readable than 5.000000e-01. llvm-svn: 142752
This commit is contained in:
parent
9adc582e35
commit
fd11994070
@ -13,17 +13,17 @@
|
||||
|
||||
#include "llvm/Support/BranchProbability.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
void BranchProbability::print(raw_ostream &OS) const {
|
||||
OS << N << " / " << D << " = " << ((double)N / D);
|
||||
OS << N << " / " << D << " = " << format("%g%%", ((double)N / D) * 100.0);
|
||||
}
|
||||
|
||||
void BranchProbability::dump() const {
|
||||
print(dbgs());
|
||||
dbgs() << "\n";
|
||||
dbgs() << *this << '\n';
|
||||
}
|
||||
|
||||
namespace llvm {
|
||||
|
Loading…
x
Reference in New Issue
Block a user