You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clang "CodeGen Function" timers from -ftime-trace for some functions falls outside of the "Frontend" timer and thus between Frontend and Backend (see attached screenshot). I think this should be counted under Frontend. In the original motivating example the time between "Frontend" and "Backend" was 11% of the overall execution time so fairly significant.
e.g. at r361164
Apply patch to trace ALL durations however small (to allow small reproducible)
Extended Description
Clang "CodeGen Function" timers from -ftime-trace for some functions falls outside of the "Frontend" timer and thus between Frontend and Backend (see attached screenshot). I think this should be counted under Frontend. In the original motivating example the time between "Frontend" and "Backend" was 11% of the overall execution time so fairly significant.
e.g. at r361164
Apply patch to trace ALL durations however small (to allow small reproducible)
diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index bc234081564..f63847a8a28 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -65,8 +65,8 @@ struct TimeTraceProfiler {
E.Duration = steady_clock::now() - E.Start;
//if (duration_cast(E.Duration).count() > TimeTraceGranularity)
Entries.emplace_back(E);
// Track total time taken by each "name", but only the topmost levels of
// them; e.g. if there's a template instantiation that instantiates other
$ cat test.cpp
template void foo(T) {}
void bar() { foo(0); }
$ clang -c -ftime-trace test.cpp
test.json now has CodeGen Function for foo between "Frontend" and "Backend"
{
"traceEvents": [
...
{
"args": {
"detail": ""
},
"dur": 1451,
"name": "Frontend",
"ph": "X",
"pid": 1,
"tid": 0,
"ts": 3722
},
{
"args": {
"detail": "foo"
},
"dur": 66,
"name": "CodeGen Function",
"ph": "X",
"pid": 1,
"tid": 0,
"ts": 5177
},
...
{
"args": {
"detail": ""
},
"dur": 2866,
"name": "Backend",
"ph": "X",
"pid": 1,
"tid": 0,
"ts": 5287
},
...
}
The text was updated successfully, but these errors were encountered: