|
MLIR 24.0.0git
|
This class represents liveness information on block level. More...
#include "mlir/Analysis/Liveness.h"
Public Types | |
| using | ValueSetT = Liveness::ValueSetT |
| A typedef declaration of a value set. | |
Public Member Functions | |
| Block * | getBlock () const |
| Returns the underlying block. | |
| const ValueSetT & | in () const |
| Returns all values that are live at the beginning of the block (unordered). | |
| const ValueSetT & | out () const |
| Returns all values that are live at the end of the block (unordered). | |
| bool | isLiveIn (Value value) const |
| Returns true if the given value is in the live-in set. | |
| bool | isLiveOut (Value value) const |
| Returns true if the given value is in the live-out set. | |
| Operation * | getStartOperation (Value value) const |
| Gets the start operation for the given value. | |
| Operation * | getEndOperation (Value value, Operation *startOperation) const |
| Gets the end operation for the given value using the start operation provided (must be referenced in this block). | |
| ValueSetT | currentlyLiveValues (Operation *op) const |
| Get the set of values that are currently live (if any) for the current op. | |
Friends | |
| class | Liveness |
This class represents liveness information on block level.
Definition at line 101 of file Liveness.h.
A typedef declaration of a value set.
Definition at line 104 of file Liveness.h.
| LivenessBlockInfo::ValueSetT LivenessBlockInfo::currentlyLiveValues | ( | Operation * | op | ) | const |
Get the set of values that are currently live (if any) for the current op.
Return the values that are currently live as of the given operation.
This analysis takes an expansive view of "live" in that if a value is defined by or within the operation or is fully consumed (as in last user) by or within the operation the value is considered "live". The values in the list are not ordered.
This check is quite expensive as it does not cache the results of the computation, so the currently live values have to be recomputed for each op.
Definition at line 398 of file Liveness.cpp.
References getEndOperation(), in(), mlir::Operation::isBeforeInBlock(), isLiveIn(), isLiveOut(), and result.
|
inline |
Returns the underlying block.
Definition at line 108 of file Liveness.h.
Gets the end operation for the given value using the start operation provided (must be referenced in this block).
Definition at line 377 of file Liveness.cpp.
References mlir::Value::getUsers(), mlir::Operation::isBeforeInBlock(), and isLiveOut().
Referenced by currentlyLiveValues(), mlir::Liveness::isDeadAfter(), and mlir::Liveness::resolveLiveness().
Gets the start operation for the given value.
Gets the start operation for the given value (must be referenced in this block).
This is the first operation the given value is considered to be live. This could either be the start operation of the current block (in case the value is live-in) or the operation that defines the given value (must be referenced in this block).
Definition at line 366 of file Liveness.cpp.
References mlir::Value::getDefiningOp(), and isLiveIn().
Referenced by mlir::bufferization::BufferPlacementAllocs::getStartOperation(), and mlir::Liveness::resolveLiveness().
|
inline |
Returns all values that are live at the beginning of the block (unordered).
Definition at line 112 of file Liveness.h.
Referenced by currentlyLiveValues(), and mlir::Liveness::getLiveIn().
Returns true if the given value is in the live-in set.
Definition at line 355 of file Liveness.cpp.
Referenced by currentlyLiveValues(), and getStartOperation().
Returns true if the given value is in the live-out set.
Definition at line 360 of file Liveness.cpp.
Referenced by currentlyLiveValues(), getEndOperation(), and mlir::Liveness::isDeadAfter().
|
inline |
Returns all values that are live at the end of the block (unordered).
Definition at line 116 of file Liveness.h.
Referenced by mlir::Liveness::getLiveOut().
|
friend |