MLIR  20.0.0git
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mlir::PassExecutionAction Class Reference

This class encapsulates the "action" of executing a single pass. More...

#include "mlir/Pass/Pass.h"

+ Inheritance diagram for mlir::PassExecutionAction:

Public Member Functions

 PassExecutionAction (ArrayRef< IRUnit > irUnits, const Pass &pass)
 Define a TypeID for this PassExecutionAction. More...
 
void print (raw_ostream &os) const override
 Print a textual version of this action to os. More...
 
const PassgetPass () const
 Get the pass that will be executed by this action. More...
 
OperationgetOp () const
 Get the operation that is the base of this pass. More...
 
- Public Member Functions inherited from mlir::tracing::ActionImpl< PassExecutionAction >
 ActionImpl (ArrayRef< IRUnit > irUnits={})
 
StringRef getTag () const final
 Forward tag access to the derived class. More...
 
- 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. More...
 
virtual ArrayRef< IRUnitgetContextIRUnits () const
 Return the set of IR units that are associated with this action. More...
 

Public Attributes

const Passpass
 Reference to the pass being run. More...
 
Operationop
 The base op for this pass. More...
 

Static Public Attributes

static constexpr StringLiteral tag = "pass-execution"
 The tag required by ActionImpl to identify this action. More...
 

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. More...
 
- 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. More...
 
ArrayRef< IRUnitirUnits
 Set of IR units (operations, regions, blocks, values) that are associated with this action. More...
 

Detailed Description

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);

Definition at line 492 of file Pass.h.

Constructor & Destructor Documentation

◆ PassExecutionAction()

PassExecutionAction::PassExecutionAction ( ArrayRef< IRUnit irUnits,
const Pass pass 
)

Define a TypeID for this PassExecutionAction.

Construct a PassExecutionAction. This is called by the OpToOpPassAdaptor when it calls executeAction.

Definition at line 39 of file Pass.cpp.

Member Function Documentation

◆ getOp()

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(), and mlir::tracing::Action::irUnits.

Referenced by print().

◆ getPass()

const Pass& mlir::PassExecutionAction::getPass ( ) const
inline

Get the pass that will be executed by this action.

This is not a class of passes, or all instances of a pass kind, this is a single pass.

Definition at line 510 of file Pass.h.

References pass.

◆ print()

void PassExecutionAction::print ( raw_ostream &  os) const
overridevirtual

Print a textual version of this action to os.

Reimplemented from mlir::tracing::Action.

Definition at line 43 of file Pass.cpp.

References mlir::Pass::getName(), getOp(), pass, and tag.

Member Data Documentation

◆ op

Operation* mlir::PassExecutionAction::op

The base op for this pass.

For an OperationPass<ModuleOp>, we would have a ModuleOp here.

Definition at line 524 of file Pass.h.

◆ pass

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 520 of file Pass.h.

Referenced by getPass(), and print().

◆ tag

constexpr StringLiteral mlir::PassExecutionAction::tag = "pass-execution"
staticconstexpr

The tag required by ActionImpl to identify this action.

Definition at line 503 of file Pass.h.

Referenced by print().


The documentation for this class was generated from the following files: