[PATCH] D131960: [WIP] [IR] Reimplement time tracing of NewPassManager by PassInstrumentation framework
Jamie Schmeiser via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 23 05:14:04 PDT 2022
jamieschmeiser added a comment.
You want the timing extensions to be the last ones called before the pass and the first ones at the end of the pass so that the overhead of the other callbacks is not included in the timings. Does PassInstrumentationCallbacks have the ability to specify that the pass be registered as the first callback? If not, add a bool parameter that allows it to be placed at the front with a default of false, and then put all timing extensions at the end, with the parameter being set to true for the registering of the atEnd callback (to put them as the first ones called). Also, add a comment that the timing ones should be last for this reason.
================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:1182
+void TimeProfilingPassesHandler::runBeforePass(StringRef PassID, Any IR) {
+ if (getTimeTraceProfilerInstance() != nullptr) {
+ timeTraceProfilerBegin(PassID, getIRName(IR));
----------------
Rather than testing if the option is set before and after each pass, test in registerCallBacks and only register when getTimeTraceProfilerInstance() returns a pointer.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131960/new/
https://reviews.llvm.org/D131960
More information about the llvm-commits
mailing list