17 #ifndef MLIR_ANALYSIS_LIVENESS_H
18 #define MLIR_ANALYSIS_LIVENESS_H
23 #include "llvm/ADT/ArrayRef.h"
24 #include "llvm/ADT/DenseMap.h"
25 #include "llvm/ADT/SmallPtrSet.h"
30 class LivenessBlockInfo;
84 void print(raw_ostream &os)
const;
145 Block *block =
nullptr;
Block represents an ordered list of Operations.
This class represents liveness information on block level.
Block * getBlock() const
Returns the underlying block.
Liveness::ValueSetT ValueSetT
A typedef declaration of a value set.
bool isLiveIn(Value value) const
Returns true if the given value is in the live-in set.
Operation * getStartOperation(Value value) const
Gets the start operation for the given value.
const ValueSetT & in() const
Returns all values that are live at the beginning of the block (unordered).
ValueSetT currentlyLiveValues(Operation *op) const
Get the set of values that are currently live (if any) for the current op.
bool isLiveOut(Value value) const
Returns true if the given value is in the live-out set.
const ValueSetT & out() const
Returns all values that are live at the end of the block (unordered).
Operation * getEndOperation(Value value, Operation *startOperation) const
Gets the end operation for the given value using the start operation provided (must be referenced in ...
Represents an analysis for computing liveness information from a given top-level operation.
bool isDeadAfter(Value value, Operation *operation) const
Returns true if value is not live after operation.
Liveness(Operation *op)
Creates a new Liveness analysis that computes liveness information for all associated regions.
Operation * getOperation() const
Returns the operation this analysis was constructed from.
DenseMap< Block *, LivenessBlockInfo > BlockMapT
OperationListT resolveLiveness(Value value) const
Gets liveness info (if any) for the given value.
const LivenessBlockInfo * getLiveness(Block *block) const
Gets liveness info (if any) for the block.
SmallPtrSet< Value, 16 > ValueSetT
void print(raw_ostream &os) const
Dumps the liveness information to the given stream.
const ValueSetT & getLiveOut(Block *block) const
Returns a reference to a set containing live-out values (unordered).
const ValueSetT & getLiveIn(Block *block) const
Returns a reference to a set containing live-in values (unordered).
std::vector< Operation * > OperationListT
void dump() const
Dumps the liveness information in a human readable format.
Operation is the basic unit of execution within MLIR.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Include the generated interface declarations.