MLIR 22.0.0git
mlir::dataflow::Liveness Struct Reference

This lattice represents, for a given value, whether or not it is "live". More...

#include "mlir/Analysis/DataFlow/LivenessAnalysis.h"

Inheritance diagram for mlir::dataflow::Liveness:

Public Member Functions

void print (raw_ostream &os) const override
ChangeResult markLive ()
ChangeResult meet (const AbstractSparseLattice &other) override
 Meet (intersect) the information in this lattice with 'rhs'.
 AbstractSparseLattice (Value value)
 Lattices can only be created for values.
Public Member Functions inherited from mlir::dataflow::AbstractSparseLattice
 AbstractSparseLattice (Value value)
 Lattices can only be created for values.
Value getAnchor () const
 Return the value this lattice is located at.
virtual ChangeResult join (const AbstractSparseLattice &rhs)
 Join the information contained in 'rhs' into this lattice.
void onUpdate (DataFlowSolver *solver) const override
 When the lattice gets updated, propagate an update to users of the value using its use-def chain to subscribed analyses.
void useDefSubscribe (DataFlowAnalysis *analysis)
 Subscribe an analysis to updates of the lattice.
Public Member Functions inherited from mlir::AnalysisState
virtual ~AnalysisState ()
 AnalysisState (LatticeAnchor anchor)
 Create the analysis state on the given lattice anchor.
LatticeAnchor getAnchor () const
 Returns the lattice anchor this state is located at.
virtual void print (raw_ostream &os) const =0
 Print the contents of the analysis state.
LLVM_DUMP_METHOD void dump () const
void addDependency (ProgramPoint *point, DataFlowAnalysis *analysis)
 Add a dependency to this analysis state on a lattice anchor and an analysis.

Public Attributes

bool isLive = false

Additional Inherited Members

Protected Attributes inherited from mlir::AnalysisState
LatticeAnchor anchor
 The lattice anchor to which the state belongs.

Detailed Description

This lattice represents, for a given value, whether or not it is "live".

A value is considered "live" iff it: (1) has memory effects OR (2) is returned by a public function OR (3) is used to compute a value of type (1) or (2). It is also to be noted that a value could be of multiple types (1/2/3) at the same time.

A value "has memory effects" iff it: (1.a) is an operand of an op with memory effects OR (1.b) is a non-forwarded branch operand and its branch op could take the control to a block that has an op with memory effects OR (1.c) is a non-forwarded call operand.

A value A is said to be "used to compute" value B iff B cannot be computed in the absence of A. Thus, in this implementation, we say that value A is used to compute value B iff: (3.a) B is a result of an op with operand A OR (3.b) A is used to compute some value C and C is used to compute B.

Definition at line 56 of file LivenessAnalysis.h.

Member Function Documentation

◆ AbstractSparseLattice()

mlir::dataflow::AbstractSparseLattice::AbstractSparseLattice ( Value value)
inline

Lattices can only be created for values.

Definition at line 37 of file SparseAnalysis.h.

Referenced by meet().

◆ markLive()

◆ meet()

ChangeResult Liveness::meet ( const AbstractSparseLattice & rhs)
overridevirtual

Meet (intersect) the information in this lattice with 'rhs'.

Returns if the value of the lattice changed.

Reimplemented from mlir::dataflow::AbstractSparseLattice.

Definition at line 42 of file LivenessAnalysis.cpp.

References AbstractSparseLattice(), isLive, markLive(), and mlir::NoChange.

◆ print()

void Liveness::print ( raw_ostream & os) const
override

Definition at line 32 of file LivenessAnalysis.cpp.

References isLive.

Member Data Documentation

◆ isLive

bool mlir::dataflow::Liveness::isLive = false

The documentation for this struct was generated from the following files: