|
MLIR 22.0.0git
|
This class encapsulates the "action" of executing a single pass. More...
#include "mlir/Pass/Pass.h"
Public Member Functions | |
| PassExecutionAction (ArrayRef< IRUnit > irUnits, const Pass &pass) | |
| Construct a PassExecutionAction. | |
| void | print (raw_ostream &os) const override |
| Print a textual version of this action to os. | |
| const Pass & | getPass () const |
| Get the pass that will be executed by this action. | |
| Operation * | getOp () const |
| Get the operation that is the base of this pass. | |
| Public Member Functions inherited from mlir::tracing::ActionImpl< PassExecutionAction > | |
| ActionImpl (ArrayRef< IRUnit > irUnits={}) | |
| StringRef | getTag () const final |
| Forward tag access to the derived class. | |
| Public Member Functions inherited from mlir::tracing::Action | |
| virtual | ~Action ()=default |
| TypeID | getActionID () const |
| Return the unique action id of this action, use for casting functionality. | |
| virtual void | print (raw_ostream &os) const |
| virtual ArrayRef< IRUnit > | getContextIRUnits () const |
| Return the set of IR units that are associated with this action. | |
Public Attributes | |
| const Pass & | pass |
| Reference to the pass being run. | |
| Operation * | op |
| The base op for this pass. | |
Static Public Attributes | |
| static constexpr StringLiteral | tag = "pass-execution" |
| The tag required by ActionImpl to identify this action. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from mlir::tracing::ActionImpl< PassExecutionAction > | |
| static bool | classof (const Action *action) |
| Provide classof to allow casting between action types. | |
| Protected Member Functions inherited from mlir::tracing::Action | |
| Action (TypeID actionID, ArrayRef< IRUnit > irUnits) | |
| Protected Attributes inherited from mlir::tracing::Action | |
| TypeID | actionID |
| The type of the derived action class, used for isa/dyn_cast. | |
| ArrayRef< IRUnit > | irUnits |
| Set of IR units (operations, regions, blocks, values) that are associated with this action. | |
This class encapsulates the "action" of executing a single pass.
This allows a user of the Action infrastructure to query information about an action in (for example) a breakpoint context. You could use it like this:
auto onBreakpoint = [&](const ActionActiveStack *backtrace) { if (auto passExec = dyn_cast<PassExecutionAction>(anAction)) record(passExec.getPass()); return ExecutionContext::Apply; }; ExecutionContext exeCtx(onBreakpoint);
Construct a PassExecutionAction.
This is called by the OpToOpPassAdaptor when it calls executeAction.
Definition at line 39 of file Pass.cpp.
References mlir::tracing::Action::irUnits, and pass.
| Operation * PassExecutionAction::getOp | ( | ) | const |
Get the operation that is the base of this pass.
For example, an OperationPass<ModuleOp> would return a ModuleOp.
Definition at line 48 of file Pass.cpp.
References mlir::tracing::Action::getContextIRUnits(), mlir::tracing::Action::irUnits, and nullptr.
Referenced by print().
|
inline |
|
override |
| Operation* mlir::PassExecutionAction::op |
The base op for this pass.
For an OperationPass<ModuleOp>, we would have a ModuleOp here.
| const Pass& mlir::PassExecutionAction::pass |
Reference to the pass being run.
Notice that this will not extend the lifetime of the pass, and so this class is therefore unsafe to keep past the lifetime of the executeAction call.
Definition at line 519 of file Pass.h.
Referenced by getPass(), PassExecutionAction(), and print().
|
staticconstexpr |