4 Commits

Author SHA1 Message Date
Mehdi Amini
2e5f6668f9 Make debug counters available in non-assert builds as well
Differential Revision: https://reviews.llvm.org/D149232
2023-04-26 08:07:24 -07: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
Mehdi Amini
9b1fe5649e Delete ActionManager and replace it with a simple callback on the Context
The concept of the ActionManager acts as a sort of "Hub" that can receive
various types of action and dispatch them to a set of registered handlers.
One handler will handle the action or it'll cascade to other handlers.

This model does not really fit the current evolution of the Action tracing
and debugging: we can't foresee a good case where this behavior compose with
the use-case behind the handlers. Instead we simplify it with a single
callback installed on the Context.

Differential Revision: https://reviews.llvm.org/D144811
2023-03-07 08:25:34 +01:00
Mehdi Amini
28d04c564d Rename DebugAction to tracing::Action and move related code from lib/Support to lib/IR and lib/Debug
This is a preparation for adding support for more infrastructure around the concept
of Action and make tracing Action more of a first class concept.
The doc will be updated later in a subsequent revision after the changes are
completed.

Action belongs to IR because of circular dependency: Actions are dispatched through
the MLIRContext but Action will learn to encapsulate IR construct.

Differential Revision: https://reviews.llvm.org/D144809
2023-03-06 16:12:30 +01:00