From 69bfa402006fa7fabe6eaf1660c9ecacb763a966 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Fri, 28 Sep 2018 05:27:32 +0000 Subject: [CodeGen] fix broken successor probability in MBB dump When printing successor probabilities for a MBB, a human readable value is sometimes shown as 200.0%. The human readable output is based on getProbabilityIterator, which returns 0xFFFFFFFF for getNumerator() and 0x80000000 for getDenominator() for unknown BranchProbability. By using getSuccProbability as we do for the non-human readable part, we can avoid this problem. Differential Revision: https://reviews.llvm.org/D52605 llvm-svn: 343297 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index c60270559fa..0b9ee462d1a 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -362,7 +362,7 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST, // Print human readable probabilities as comments. OS << "; "; for (auto I = succ_begin(), E = succ_end(); I != E; ++I) { - const BranchProbability &BP = *getProbabilityIterator(I); + const BranchProbability &BP = getSuccProbability(I); if (I != succ_begin()) OS << ", "; OS << printMBBReference(**I) << '(' -- cgit v1.2.3