mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-02 22:32:08 +00:00
Print branch probabilities as percentages.
50% is much more readable than 5.000000e-01. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
341473c86d
commit
7102b617bf
@ -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