[llvm] [llvm-mca] Round UP when formatting Reciprocal Throughput (PR #159544)

Simon Wallis via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 00:13:03 PDT 2025


================
@@ -136,7 +136,7 @@ void InstructionInfoView::printView(raw_ostream &OS) const {
     FOS.PadToColumn(Paddings[2]);
     if (IIVDEntry.RThroughput) {
       double RT = *IIVDEntry.RThroughput;
-      FOS << format("%.2f", RT);
+      FOS << format("%.2f", floor((RT * 100) + 0.5) / 100);
----------------
simonwallis2 wrote:

> nit: there will be an implicit promotion but perhaps we could just spell out `100.0`?

I see what you mean, but in the spirit of "invisible mending", 100 matches the 30 or so other uses of implicitly promoted integer `100` in llvm-mca/Views.

https://github.com/llvm/llvm-project/pull/159544


More information about the llvm-commits mailing list