MLIR  20.0.0git
Public Member Functions | List of all members
mlir::dataflow::PredecessorState Class Reference

This analysis state represents a set of live control-flow "predecessors" of a program point (either an operation or a block), which are the last operations along all execution paths that pass through this point. More...

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

+ Inheritance diagram for mlir::dataflow::PredecessorState:

Public Member Functions

void print (raw_ostream &os) const override
 Print the known predecessors. More...
 
bool allPredecessorsKnown () const
 Returns true if all predecessors are known. More...
 
ChangeResult setHasUnknownPredecessors ()
 Indicate that there are potentially unknown predecessors. More...
 
ArrayRef< Operation * > getKnownPredecessors () const
 Get the known predecessors. More...
 
ValueRange getSuccessorInputs (Operation *predecessor) const
 Get the successor inputs from a predecessor. More...
 
ChangeResult join (Operation *predecessor)
 Add a known predecessor. More...
 
ChangeResult join (Operation *predecessor, ValueRange inputs)
 Add a known predecessor with successor inputs. More...
 
 AnalysisState (LatticeAnchor anchor)
 Create the analysis state on the given lattice anchor. 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...
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::AnalysisState
virtual void onUpdate (DataFlowSolver *solver) const
 This function is called by the solver when the analysis state is updated to enqueue more work items. More...
 
- Protected Attributes inherited from mlir::AnalysisState
LatticeAnchor anchor
 The lattice anchor to which the state belongs. More...
 

Detailed Description

This analysis state represents a set of live control-flow "predecessors" of a program point (either an operation or a block), which are the last operations along all execution paths that pass through this point.

For example, in dead-code analysis, an operation with region control-flow can be the predecessor of a region's entry block or itself, the exiting terminator of a region can be the predecessor of the parent operation or another region's entry block, the callsite of a callable operation can be the predecessor to its entry block, and the exiting terminator or a callable operation can be the predecessor of the call operation.

The state can optionally contain information about which values are propagated from each predecessor to the successor point.

The state can indicate that it is underdefined, meaning that not all live control-flow predecessors can be known.

Definition at line 93 of file DeadCodeAnalysis.h.

Member Function Documentation

◆ allPredecessorsKnown()

bool mlir::dataflow::PredecessorState::allPredecessorsKnown ( ) const
inline

Returns true if all predecessors are known.

Definition at line 101 of file DeadCodeAnalysis.h.

Referenced by print().

◆ AnalysisState()

mlir::AnalysisState::AnalysisState
inline

Create the analysis state on the given lattice anchor.

Definition at line 452 of file DataFlowFramework.h.

◆ getKnownPredecessors()

ArrayRef<Operation *> mlir::dataflow::PredecessorState::getKnownPredecessors ( ) const
inline

Get the known predecessors.

Definition at line 110 of file DeadCodeAnalysis.h.

Referenced by print().

◆ getSuccessorInputs()

ValueRange mlir::dataflow::PredecessorState::getSuccessorInputs ( Operation predecessor) const
inline

Get the successor inputs from a predecessor.

Definition at line 115 of file DeadCodeAnalysis.h.

◆ join() [1/2]

ChangeResult PredecessorState::join ( Operation predecessor)

Add a known predecessor.

Definition at line 82 of file DeadCodeAnalysis.cpp.

References mlir::Change, and mlir::NoChange.

Referenced by join().

◆ join() [2/2]

ChangeResult PredecessorState::join ( Operation predecessor,
ValueRange  inputs 
)

Add a known predecessor with successor inputs.

Definition at line 87 of file DeadCodeAnalysis.cpp.

References mlir::Change, and join().

◆ print()

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

Print the known predecessors.

Implements mlir::AnalysisState.

Definition at line 74 of file DeadCodeAnalysis.cpp.

References allPredecessorsKnown(), and getKnownPredecessors().

◆ setHasUnknownPredecessors()

ChangeResult mlir::dataflow::PredecessorState::setHasUnknownPredecessors ( )
inline

Indicate that there are potentially unknown predecessors.

Definition at line 104 of file DeadCodeAnalysis.h.

References mlir::Change, and mlir::NoChange.


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