MLIR  20.0.0git
Public Member Functions | Public Attributes | List of all members
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
 Print the contents of the analysis state. More...
 
ChangeResult markLive ()
 
ChangeResult meet (const AbstractSparseLattice &other) override
 Meet (intersect) the information in this lattice with 'rhs'. More...
 
 AbstractSparseLattice (Value value)
 Lattices can only be created for values. More...
 
- Public Member Functions inherited from mlir::dataflow::AbstractSparseLattice
 AbstractSparseLattice (Value value)
 Lattices can only be created for values. More...
 
Value getAnchor () const
 Return the value this lattice is located at. More...
 
virtual ChangeResult join (const AbstractSparseLattice &rhs)
 Join the information contained in 'rhs' into this lattice. More...
 
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. More...
 
void useDefSubscribe (DataFlowAnalysis *analysis)
 Subscribe an analysis to updates of the lattice. More...
 
- Public Member Functions inherited from mlir::AnalysisState
virtual ~AnalysisState ()
 
 AnalysisState (LatticeAnchor anchor)
 Create the analysis state on the given lattice anchor. More...
 
LatticeAnchor getAnchor () const
 Returns the lattice anchor this state is located at. More...
 
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. More...
 

Public Attributes

bool isLive = false
 

Additional Inherited Members

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

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
inline

Lattices can only be created for values.

Definition at line 37 of file SparseAnalysis.h.

◆ markLive()

ChangeResult Liveness::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 40 of file LivenessAnalysis.cpp.

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

◆ print()

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

Print the contents of the analysis state.

Implements mlir::AnalysisState.

Definition at line 30 of file LivenessAnalysis.cpp.

References isLive.

Member Data Documentation

◆ isLive

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

Definition at line 69 of file LivenessAnalysis.h.

Referenced by markLive(), meet(), and print().


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