This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] avoid broken successor probability in MBB dump
ClosedPublic

Authored by inouehrs on Sep 27 2018, 4:58 AM.

Details

Summary

When printing successor probabilities for a MBB, a human readble value is somethimes shown as 200%.
The human readble 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.

Example of broken probability

bb.1.if.then:
; predecessors: %bb.0
  successors: %bb.3(0x80000000); %bb.3(200.00%)

Diff Detail

Repository
rL LLVM

Event Timeline

inouehrs created this revision.Sep 27 2018, 4:58 AM
inouehrs edited the summary of this revision. (Show Details)
thegameg accepted this revision.Sep 27 2018, 5:37 AM

LGTM. It would be nice to have a test too.

This revision is now accepted and ready to land.Sep 27 2018, 5:37 AM
This revision was automatically updated to reflect the committed changes.