summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRPrinter.cpp
diff options
context:
space:
mode:
authorGeoff Berry <gberry@codeaurora.org>2016-11-18 19:37:24 +0000
committerGeoff Berry <gberry@codeaurora.org>2016-11-18 19:37:24 +0000
commitb51774ac8ca27bb4705a61754781382fadbd1f22 (patch)
treec083a2a54522a3753af638244397120680114faa /llvm/lib/CodeGen/MIRPrinter.cpp
parent2a3d10ae613af37491fd81747ec418d2d93635b0 (diff)
downloadbcm5719-llvm-b51774ac8ca27bb4705a61754781382fadbd1f22.tar.gz
bcm5719-llvm-b51774ac8ca27bb4705a61754781382fadbd1f22.zip
[MIRPrinter] Print raw branch probabilities as expected by MIRParser
Fixes PR28751. Reviewers: MatzeB, qcolombet Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D26775 llvm-svn: 287368
Diffstat (limited to 'llvm/lib/CodeGen/MIRPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRPrinter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 884defb9dbf..2b5c789605d 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -32,6 +32,7 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
@@ -481,7 +482,9 @@ void MIPrinter::print(const MachineBasicBlock &MBB) {
OS << ", ";
printMBBReference(**I);
if (MBB.hasSuccessorProbabilities())
- OS << '(' << MBB.getSuccProbability(I) << ')';
+ OS << '('
+ << format("0x%08" PRIx32, MBB.getSuccProbability(I).getNumerator())
+ << ')';
}
OS << "\n";
HasLineAttributes = true;
OpenPOWER on IntegriCloud