[MLIR] Factor pass timing out into a dedicated timing manager
authorFabian Schuiki <fabian@schuiki.ch>
Wed, 21 Apr 2021 08:57:29 +0000 (10:57 +0200)
committerFabian Schuiki <fabian@schuiki.ch>
Wed, 12 May 2021 16:14:51 +0000 (18:14 +0200)
commit33f908c42881fa02963f0c64f8be5088717664cc
treed60f09ae820d587bc5c109d4d8a371c6c86bd14e
parentcf4610d27bbb5c3a744374440e2fdf77caa12040
[MLIR] Factor pass timing out into a dedicated timing manager

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
12 files changed:
mlir/docs/PassManagement.md
mlir/include/mlir/Pass/Pass.h
mlir/include/mlir/Pass/PassManager.h
mlir/include/mlir/Support/Timing.h [new file with mode: 0644]
mlir/lib/Pass/Pass.cpp
mlir/lib/Pass/PassManagerOptions.cpp
mlir/lib/Pass/PassTiming.cpp
mlir/lib/Support/CMakeLists.txt
mlir/lib/Support/MlirOptMain.cpp
mlir/lib/Support/Timing.cpp [new file with mode: 0644]
mlir/test/Pass/pass-timing.mlir
mlir/test/Pass/pipeline-parsing.mlir