summaryrefslogtreecommitdiff
path: root/mlir/lib/Support/Timing.cpp
AgeCommit message (Collapse)Author
2025-11-06[mlir] Expose output strategies of TimingManager (#166548)Andrei Golubev
After the original API change to DefaultTimingManager::setOutput() (see 362aa434cc31ccca96749a6db8cd97f5b7d71206), users are forced to provide their own implementation of OutputStrategy. However, default MLIR implementations are usually sufficient. Expose Text and Json strategies via factory-like method to avoid the problem in downstream projects.
2025-11-01[ADT] Use a dedicated empty type for StringSet (NFC) (#165967)Kazu Hirata
This patch introduces StringSetTag, a dedicated empty struct to serve as the "value type" for llvm::StringSet. This change is part of an effort to reduce the use of std::nullopt_t outside the context of std::optional.
2025-10-30[mlir] Fix use-after-move issues (#165660)Slava Gurevich
This patch addresses two use-after-move issues: 1. `Timing.cpp` A variable was std::moved and then immediately passed to an `assert()` check. Since the moved-from state made the assertion condition trivially true, the check was effectively useless. The `assert()` is removed. 2. `Query.cpp` The `matcher` object was moved-from and then subsequently used as if it still retained valid state. The fix ensures no subsequent use for the moved-from variable. Testing: `ninja check-mlir`
2025-07-15[mlir] Remove unused includes (NFC) (#148872)Kazu Hirata
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
2024-04-03[mlir] Initialize DefaultTimingManager::out. (#87522)Chenguang Wang
`DefaultTimingManager::clear()` uses `out` to initialize `TimerImpl`, but the `out` is `nullptr` by default. This means if `DefaultTimingManager::setOutput()` is never called, `DefaultTimingManager` destructor may generate SIGSEGV.
2024-04-03[mlir] Enhance TimingManager Printing Flexibility (#85821)Hsiangkai Wang
Revise the printing functionality of TimingManager to accommodate various output formats. At present, TimingManager is limited to outputting data solely in plain text format. To overcome this limitation, I have introduced an abstract class that serves as the foundation for printing. This approach allows users to implement additional output formats by extending this abstract class. As part of this update, I have integrated support for JSON as a new output format, enhancing the ease of parsing for subsequent processing scripts.
2024-02-15Apply clang-tidy fixes for llvm-include-order in Timing.cpp (NFC)Mehdi Amini
2023-01-14[mlir] Use std::optional instead of llvm::Optional (NFC)Kazu Hirata
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2023-01-13[mlir] Add #include <optional> (NFC)Kazu Hirata
This patch adds #include <optional> to those files containing llvm::Optional<...> or Optional<...>. I'll post a separate patch to actually replace llvm::Optional with std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-12-03[mlir] Use std::nullopt instead of None (NFC)Kazu Hirata
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-23Use std::nullopt_t instead of NoneType (NFC)Kazu Hirata
This patch replaces those occurrences of NoneType that would trigger an error if the definition of NoneType were missing in None.h. To keep this patch focused, I am deliberately not replacing None with std::nullopt in this patch or updating comments. They will be addressed in subsequent patches. This is part of an effort to migrate from llvm::Optional to std::optional: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 Differential Revision: https://reviews.llvm.org/D138539
2022-06-20Don't use Optional::hasValue (NFC)Kazu Hirata
2022-01-02Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)Mehdi Amini
2021-12-22Fix more clang-tidy cleanups in mlir/ (NFC)Mehdi Amini
2021-12-08Adjust "end namespace" comment in MLIR to match new agree'd coding styleMehdi Amini
See D115115 and this mailing list discussion: https://lists.llvm.org/pipermail/llvm-dev/2021-December/154199.html Differential Revision: https://reviews.llvm.org/D115309
2021-07-22[mlir] Fix various issues in TimerImpl.rdzhabarov
More specifically: 1) Use variable after move. 2) steady_clock needs to be used for measuring time intervals, but not the system_clock. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D106513
2021-05-12[MLIR] Factor pass timing out into a dedicated timing managerFabian Schuiki
This factors out the pass timing code into a separate `TimingManager` that can be plugged into the `PassManager` from the outside. Users are able to provide their own implementation of this manager, and use it to time additional code paths outside of the pass manager. Also allows for multiple `PassManager`s to run and contribute to a single timing report. More specifically, moves most of the existing infrastructure in `Pass/PassTiming.cpp` into a new `Support/Timing.cpp` file and adds a public interface in `Support/Timing.h`. The `PassTiming` instrumentation becomes a wrapper around the new timing infrastructure which adapts the instrumentation callbacks to the new timers. Reviewed By: rriddle, lattner Differential Revision: https://reviews.llvm.org/D100647