9 Commits

Author SHA1 Message Date
Mehdi Amini
b82f3747da Revert "Minor fixes on the MLIR ActionProfiler (NFC)"
This reverts commit 0502d83470202de6412d4b310692c7b06f1791cb.

This introduces a race condition on the printComma variable.
2023-10-03 12:15:35 -07:00
Mehdi Amini
0502d83470 Minor fixes on the MLIR ActionProfiler (NFC)
Ensure the stream flushed to the string before acquiring the mutext.
No need to flush the output stream, the goal of the mutex is to sync
ahead before content is added to the stream.
2023-10-02 20:11:18 -07:00
Antonio Cortes Perez
f33afea260
[mlir] Add an Observer for profiling actions to a stream. (#67251)
The profile is stored in the Chrome trace event format.

Added the --profile-action-to=<file> option to mlir-opt.
2023-10-02 20:07:10 -07:00
Mehdi Amini
7f069f5ef4 Add a breakpoint manager that matches based on File/Line/Col Locations
This will match the locations attached to the IRunits passed in as context
with an action.

This is a recommit of d09c80515d0e after fixing the test on Windows.

Differential Revision: https://reviews.llvm.org/D144815
2023-04-21 23:54:20 -06:00
Mehdi Amini
6fb4c9fdc1 Revert "Add a breakpoint manager that matches based on File/Line/Col Locations"
This reverts commit d09c80515d0e7b1f1a81d3f18a3e799565f5e969.

This is broken on Windows
2023-04-21 23:24:05 -06:00
Mehdi Amini
d09c80515d Add a breakpoint manager that matches based on File/Line/Col Locations
This will match the locations attached to the IRunits passed in as context
with an action.

Differential Revision: https://reviews.llvm.org/D144815
2023-04-21 22:28:27 -06:00
Mehdi Amini
46c6166d33 Fix MLIR build with shared library enabled
Broken by f406adf134c2f
2023-03-20 14:04:15 +01:00
Mehdi Amini
f406adf134 Add capture of "IRUnits" as context for an MLIR Action
IRUnit is defined as:

  using IRUnit = PointerUnion<Operation *, Region *, Block *, Value>;

The tracing::Action is extended to take an ArrayRef<IRUnit> as context to
describe an Action. It is demonstrated in the "ActionLogging" observer.

Reviewed By: rriddle, Mogball

Differential Revision: https://reviews.llvm.org/D144814
2023-03-20 13:40:55 +01:00
Mehdi Amini
930744fcda Add an Observer for logging actions application to a stream
Integrate the `tracing::ExecutionContext()` into mlir-opt with a new
--log-action-to=<file> option to demonstrate the feature.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D144813
2023-03-20 13:39:01 +01:00