Skip to content

Commit 045fbd4

Browse files
authored
Improve output format for lowering passes timing. (#8749)
1 parent 21d2587 commit 045fbd4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Lower.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <algorithm>
22
#include <chrono>
3+
#include <iomanip>
34
#include <iostream>
45
#include <set>
56
#include <sstream>
@@ -120,11 +121,15 @@ class LoweringLogger {
120121

121122
~LoweringLogger() {
122123
if (time_lowering_passes) {
124+
double total = 0.0;
123125
debug(0) << "Lowering pass runtimes:\n";
124126
std::sort(timings.begin(), timings.end());
125127
for (const auto &p : timings) {
126-
debug(0) << " " << p.first << " ms : " << p.second << "\n";
128+
total += p.first;
129+
debug(0) << std::setw(10) << std::fixed << std::setprecision(3) << p.first << " ms : "
130+
<< p.second << "\n";
127131
}
132+
debug(0) << std::setw(10) << std::fixed << std::setprecision(3) << total << " ms in total\n";
128133
}
129134
}
130135
};

0 commit comments

Comments
 (0)