MLIR
20.0.0git
|
A utility class to encode the current walk stage for "generic" walkers. More...
#include "mlir/IR/Visitors.h"
Public Member Functions | |
WalkStage (Operation *op) | |
bool | isBeforeAllRegions () const |
Return true if parent operation is being visited before all regions. More... | |
bool | isBeforeRegion (int region) const |
Returns true if parent operation is being visited just before visiting region number region . More... | |
bool | isAfterRegion (int region) const |
Returns true if parent operation is being visited just after visiting region number region . More... | |
bool | isAfterAllRegions () const |
Return true if parent operation is being visited after all regions. More... | |
void | advance () |
Advance the walk stage. More... | |
int | getNextRegion () const |
Returns the next region that will be visited. More... | |
A utility class to encode the current walk stage for "generic" walkers.
When walking an operation, we can either choose a Pre/Post order walker which invokes the callback on an operation before/after all its attached regions have been visited, or choose a "generic" walker where the callback is invoked on the operation N+1 times where N is the number of regions attached to that operation. The WalkStage
class below encodes the current stage of the walk, i.e., which regions have already been visited, and the callback accepts an additional argument for the current stage. Such generic walkers that accept stage-aware callbacks are only applicable when the callback operates on an operation (i.e., not applicable for callbacks on Blocks or Regions).
Definition at line 87 of file Visitors.h.
|
explicit |
Definition at line 14 of file Visitors.cpp.
|
inline |
Advance the walk stage.
Definition at line 102 of file Visitors.h.
|
inline |
Returns the next region that will be visited.
Definition at line 104 of file Visitors.h.
|
inline |
Return true if parent operation is being visited after all regions.
Definition at line 100 of file Visitors.h.
|
inline |
Returns true if parent operation is being visited just after visiting region number region
.
Definition at line 98 of file Visitors.h.
|
inline |
Return true if parent operation is being visited before all regions.
Definition at line 92 of file Visitors.h.
|
inline |
Returns true if parent operation is being visited just before visiting region number region
.
Definition at line 95 of file Visitors.h.