[all-commits] [llvm/llvm-project] 09d8e4: [llvm][Timer] Use global TimerGroups for both new ...
Alan Zhao via All-commits
all-commits at lists.llvm.org
Thu Mar 13 10:13:49 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 09d8e442ac2884aabe4cdfb01d1444b54cff7147
https://github.com/llvm/llvm-project/commit/09d8e442ac2884aabe4cdfb01d1444b54cff7147
Author: Alan Zhao <ayzhao at google.com>
Date: 2025-03-13 (Thu, 13 Mar 2025)
Changed paths:
M clang/test/Misc/time-passes.c
M llvm/include/llvm/IR/PassTimingInfo.h
M llvm/include/llvm/Support/Timer.h
M llvm/lib/IR/PassTimingInfo.cpp
M llvm/lib/Support/Timer.cpp
M llvm/unittests/IR/TimePassesTest.cpp
Log Message:
-----------
[llvm][Timer] Use global TimerGroups for both new pass manager and old pass manager timers (#130375)
Additionally, remove the behavior for both pass manager's timer manager
classes (`PassTimingInfo` for the old pass manager and
`TimePassesHandler` for the new pass manager) where these classes would
print the values of their timers upon destruction.
Currently, each pass manager manages their own `TimerGroup`s. This is
problematic because of duplicate `TimerGroup`s (both pass managers have
a `TimerGroup` for pass times with identical names and descriptions).
The result is that in Clang, `-ftime-report` has two "Pass execution
timing report" sections (one for the new pass manager which manages
optimization passes, and one for the old pass manager which manages the
backend). The result of this change is that Clang's `-ftime-report` now
prints both optimization and backend pass timing info in a unified "Pass
execution timing report" section.
Moving the ownership of the `TimerGroups` to globals also makes it
easier to implement JSON-formatted `-ftime-report`. This was not
possible with the old structure because the two pass managers were
created and destroyed in far parts of the codebase and outputting JSON
requires the printing logic to be at the same place because of
formatting.
Previous discourse discussion:
https://discourse.llvm.org/t/difficulties-with-implementing-json-formatted-ftime-report/84353
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list