MLIR
20.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. More... | |
Public Member Functions | |
Block * | getBlock () const |
Returns the underlying block. More... | |
const ValueSetT & | in () const |
Returns all values that are live at the beginning of the block (unordered). More... | |
const ValueSetT & | out () const |
Returns all values that are live at the end of the block (unordered). More... | |
bool | isLiveIn (Value value) const |
Returns true if the given value is in the live-in set. More... | |
bool | isLiveOut (Value value) const |
Returns true if the given value is in the live-out set. More... | |
Operation * | getStartOperation (Value value) const |
Gets the start operation for the given value. More... | |
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). More... | |
ValueSetT | currentlyLiveValues (Operation *op) const |
Get the set of values that are currently live (if any) for the current op. More... | |
Friends | |
class | Liveness |
This class represents liveness information on block level.
Definition at line 99 of file Liveness.h.
A typedef declaration of a value set.
Definition at line 102 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 400 of file Liveness.cpp.
References getEndOperation(), in(), mlir::Operation::isBeforeInBlock(), isLiveIn(), and isLiveOut().
|
inline |
Returns the underlying block.
Definition at line 106 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 379 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 368 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 110 of file Liveness.h.
Referenced by currentlyLiveValues(), and mlir::Liveness::getLiveIn().
bool LivenessBlockInfo::isLiveIn | ( | Value | value | ) | const |
Returns true if the given value is in the live-in set.
Definition at line 357 of file Liveness.cpp.
Referenced by currentlyLiveValues(), and getStartOperation().
bool LivenessBlockInfo::isLiveOut | ( | Value | value | ) | const |
Returns true if the given value is in the live-out set.
Definition at line 362 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 114 of file Liveness.h.
Referenced by mlir::Liveness::getLiveOut().
Definition at line 153 of file Liveness.h.