My Project
|
#include <Liveness.h>
Public Types | |
using | OperationListT = std::vector< Operation * > |
using | BlockMapT = DenseMap< Block *, LivenessBlockInfo > |
using | ValueSetT = SmallPtrSet< Value, 16 > |
Public Member Functions | |
Liveness (Operation *op) | |
Operation * | getOperation () const |
Returns the operation this analysis was constructed from. More... | |
OperationListT | resolveLiveness (Value value) const |
Gets liveness info (if any) for the given value. More... | |
const LivenessBlockInfo * | getLiveness (Block *block) const |
Gets liveness info (if any) for the block. More... | |
const ValueSetT & | getLiveIn (Block *block) const |
Returns a reference to a set containing live-in values (unordered). More... | |
const ValueSetT & | getLiveOut (Block *block) const |
Returns a reference to a set containing live-out values (unordered). More... | |
bool | isLastUse (Value value, Operation *operation) const |
void | dump () const |
Dumps the liveness information in a human readable format. More... | |
void | print (raw_ostream &os) const |
Dumps the liveness information to the given stream. More... | |
Represents an analysis for computing liveness information from a given top-level operation. The analysis iterates over all associated regions that are attached to the given top-level operation. It computes liveness information for every value and block that are included in the mentioned regions. It relies on a fixpoint iteration to compute all live-in and live-out values of all included blocks. Sample usage: Liveness liveness(topLevelOp); auto &allInValues = liveness.getLiveIn(block); auto &allOutValues = liveness.getLiveOut(block); auto allOperationsInWhichValueIsLive = liveness.resolveLiveness(value); bool lastUse = liveness.isLastUse(value, operation);
using mlir::Liveness::BlockMapT = DenseMap<Block *, LivenessBlockInfo> |
using mlir::Liveness::OperationListT = std::vector<Operation *> |
using mlir::Liveness::ValueSetT = SmallPtrSet<Value, 16> |
Liveness::Liveness | ( | Operation * | op | ) |
Creates a new Liveness analysis that computes liveness information for all associated regions.
void Liveness::dump | ( | ) | const |
Dumps the liveness information in a human readable format.
const Liveness::ValueSetT & Liveness::getLiveIn | ( | Block * | block | ) | const |
Returns a reference to a set containing live-in values (unordered).
Returns a reference to a set containing live-in values.
const LivenessBlockInfo * Liveness::getLiveness | ( | Block * | block | ) | const |
Gets liveness info (if any) for the block.
const Liveness::ValueSetT & Liveness::getLiveOut | ( | Block * | block | ) | const |
Returns a reference to a set containing live-out values (unordered).
Returns a reference to a set containing live-out values.
|
inline |
Returns the operation this analysis was constructed from.
Returns true if the given operation represent the last use of the given value.
void Liveness::print | ( | raw_ostream & | os | ) | const |
Dumps the liveness information to the given stream.
Liveness::OperationListT Liveness::resolveLiveness | ( | Value | value | ) | const |
Gets liveness info (if any) for the given value.
Gets liveness info (if any) for the given value. This includes all operations in which the given value is live. Note that the operations in this list are not ordered and the current implementation is computationally expensive (as it iterates over all blocks in which the given value is live).