This is an archive of the discontinued LLVM Phabricator instance.

[MIRPrinter] Print raw branch probabilities as expected by MIRParser
ClosedPublic

Authored by gberry on Nov 16 2016, 4:30 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

gberry updated this revision to Diff 78287.Nov 16 2016, 4:30 PM
gberry retitled this revision from to [MIRPrinter] Print raw branch probabilities as expected by MIRParser.
gberry updated this object.
gberry added reviewers: MatzeB, qcolombet.
gberry added a subscriber: llvm-commits.
MatzeB accepted this revision.Nov 17 2016, 11:25 AM
MatzeB edited edge metadata.

Thanks, this will fix http://llvm.org/PR28751

LGTM with the points below addressed:

include/llvm/Support/BranchProbability.h
73 ↗(On Diff #78287)

I would lean towards just adding a getRaw() const function and leaving the printing to the MIRPrinter in the grounds that there is no matching parseRaw() function here as well.

The fact that the current code broke, is because the MIRPrinter was implemented with print() whose format changed in time, while the parse in MIParser stayed the same.

lib/CodeGen/MIRPrinter.cpp
485 ↗(On Diff #78287)

I'd lean towards printing it in hex.

This revision is now accepted and ready to land.Nov 17 2016, 11:25 AM
This revision was automatically updated to reflect the committed changes.