diff options
| author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-05-24 17:22:14 +0000 |
|---|---|---|
| committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-05-24 17:22:14 +0000 |
| commit | 0af811519aecb8530b1681c32738b22213cd20f0 (patch) | |
| tree | 480d5ccab9a504029a56f0909e3112a30efef54d /llvm/tools | |
| parent | 4b25b3e4a6088df440813296f6b35dd28b8abe7b (diff) | |
| download | bcm5719-llvm-0af811519aecb8530b1681c32738b22213cd20f0.tar.gz bcm5719-llvm-0af811519aecb8530b1681c32738b22213cd20f0.zip | |
[llvm-mca] Fix a rounding problem in SummaryView.cpp exposed by r333204.
Before printing the block reciprocal throughput, ensure that the floating point
number is always rounded the same way on every target.
No functional change intended.
llvm-svn: 333210
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-mca/SummaryView.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/tools/llvm-mca/SummaryView.cpp b/llvm/tools/llvm-mca/SummaryView.cpp index 9b6e1d9b183..c4746c62c0d 100644 --- a/llvm/tools/llvm-mca/SummaryView.cpp +++ b/llvm/tools/llvm-mca/SummaryView.cpp @@ -34,9 +34,9 @@ void SummaryView::onInstructionEvent(const HWInstructionEvent &Event) { return; // Update the cumulative number of resource cycles based on the processor - // resource usage information available from the instruction descriptor. We need to - // compute the cumulative number of resource cycles for every processor - // resource which is consumed by an instruction of the block. + // resource usage information available from the instruction descriptor. We + // need to compute the cumulative number of resource cycles for every + // processor resource which is consumed by an instruction of the block. const Instruction &Inst = *Event.IR.getInstruction(); const InstrDesc &Desc = Inst.getDesc(); NumMicroOps += Desc.NumMicroOps; @@ -99,7 +99,10 @@ void SummaryView::printView(raw_ostream &OS) const { TempStream << "\nTotal Cycles: " << TotalCycles; TempStream << "\nDispatch Width: " << DispatchWidth; TempStream << "\nIPC: " << format("%.2f", IPC); - TempStream << "\nBlock RThroughput: " << format("%.1f", BlockRThroughput) + + // Round to the block reciprocal throughput to the nearest tenth. + TempStream << "\nBlock RThroughput: " + << format("%.1f", floor((BlockRThroughput * 10) + 0.5) / 10) << '\n'; TempStream.flush(); OS << Buffer; |

