mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
[CodeGen] Don't compute BranchProbability for MBB::print
Avoid re-computing BP only to print successor probabilities in -debug printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -341,23 +341,27 @@ void MachineBasicBlock::print(raw_ostream &OS, ModuleSlotTracker &MST,
|
||||
if (I != succ_begin())
|
||||
OS << ", ";
|
||||
OS << printMBBReference(**I);
|
||||
OS << '(' << format("0x%08" PRIx32, getSuccProbability(I).getNumerator())
|
||||
<< ')';
|
||||
if (!Probs.empty())
|
||||
OS << '('
|
||||
<< format("0x%08" PRIx32, getSuccProbability(I).getNumerator())
|
||||
<< ')';
|
||||
}
|
||||
// Print human readable probabilities as comments.
|
||||
OS << "; ";
|
||||
for (auto I = succ_begin(), E = succ_end(); I != E; ++I) {
|
||||
const BranchProbability &BP = *getProbabilityIterator(I);
|
||||
if (I != succ_begin())
|
||||
OS << ", ";
|
||||
OS << printMBBReference(**I) << '('
|
||||
<< format("%.2f%%",
|
||||
rint(((double)BP.getNumerator() / BP.getDenominator()) *
|
||||
100.0 * 100.0) /
|
||||
100.0)
|
||||
<< ')';
|
||||
if (!Probs.empty()) {
|
||||
// Print human readable probabilities as comments.
|
||||
OS << "; ";
|
||||
for (auto I = succ_begin(), E = succ_end(); I != E; ++I) {
|
||||
const BranchProbability &BP = *getProbabilityIterator(I);
|
||||
if (I != succ_begin())
|
||||
OS << ", ";
|
||||
OS << printMBBReference(**I) << '('
|
||||
<< format("%.2f%%",
|
||||
rint(((double)BP.getNumerator() / BP.getDenominator()) *
|
||||
100.0 * 100.0) /
|
||||
100.0)
|
||||
<< ')';
|
||||
}
|
||||
OS << '\n';
|
||||
}
|
||||
OS << '\n';
|
||||
}
|
||||
|
||||
// Print the preds of this block according to the CFG.
|
||||
|
||||
Reference in New Issue
Block a user