[PATCH] D92146: [Timer] Add the timer option -sort-timers to enable/disable report sorting
Paul C. Anagnostopoulos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 28 08:44:18 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0aeaec13e76a: [Timer] Add a command option to enable/disable timer sorting. (authored by Paul-C-Anagnostopoulos).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92146/new/
https://reviews.llvm.org/D92146
Files:
llvm/include/llvm/TableGen/Record.h
llvm/lib/Support/Timer.cpp
llvm/utils/TableGen/DAGISelEmitter.cpp
Index: llvm/utils/TableGen/DAGISelEmitter.cpp
===================================================================
--- llvm/utils/TableGen/DAGISelEmitter.cpp
+++ llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -189,6 +189,7 @@
namespace llvm {
void EmitDAGISel(RecordKeeper &RK, raw_ostream &OS) {
+ RK.startTimer("Parse patterns");
DAGISelEmitter(RK).run(OS);
}
Index: llvm/lib/Support/Timer.cpp
===================================================================
--- llvm/lib/Support/Timer.cpp
+++ llvm/lib/Support/Timer.cpp
@@ -53,6 +53,11 @@
InfoOutputFilename("info-output-file", cl::value_desc("filename"),
cl::desc("File to append -stats and -timer output to"),
cl::Hidden, cl::location(getLibSupportInfoOutputFilename()));
+
+ static cl::opt<bool>
+ SortTimers("sort-timers", cl::desc("In the report, sort the timers in each group "
+ "in wall clock time order"),
+ cl::init(true), cl::Hidden);
}
std::unique_ptr<raw_fd_ostream> llvm::CreateInfoOutputFile() {
@@ -301,8 +306,9 @@
}
void TimerGroup::PrintQueuedTimers(raw_ostream &OS) {
- // Sort the timers in descending order by amount of time taken.
- llvm::sort(TimersToPrint);
+ // Perhaps sort the timers in descending order by amount of time taken.
+ if (SortTimers)
+ llvm::sort(TimersToPrint);
TimeRecord Total;
for (const PrintRecord &Record : TimersToPrint)
Index: llvm/include/llvm/TableGen/Record.h
===================================================================
--- llvm/include/llvm/TableGen/Record.h
+++ llvm/include/llvm/TableGen/Record.h
@@ -1829,7 +1829,7 @@
/// Stop timing a phase.
void stopTimer();
- /// Start timing the overall backend. If the backend starts a timer,
+ /// Start timing the overall backend. If the backend itself starts a timer,
/// then this timer is cleared.
void startBackendTimer(StringRef Name);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92146.308170.patch
Type: text/x-patch
Size: 1943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201128/d08c4016/attachment.bin>
More information about the llvm-commits
mailing list