[CodeGen] fix broken successor probability in MBB dump
authorHiroshi Inoue <inouehrs@jp.ibm.com>
Fri, 28 Sep 2018 05:27:32 +0000 (05:27 +0000)
committerHiroshi Inoue <inouehrs@jp.ibm.com>
Fri, 28 Sep 2018 05:27:32 +0000 (05:27 +0000)
commit69bfa402006fa7fabe6eaf1660c9ecacb763a966
tree97708202b9130d1603ba14586af4eaa90182268a
parent73d18aa028b367ef68c543f15f10427a4d1cb471
[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
llvm/test/Other/X86/mbb-dump.ll [new file with mode: 0644]