MLIR  19.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 (ProgramPoint point)
 Create the analysis state at the given program point. More...
 
- Public Member Functions inherited from mlir::AnalysisState
virtual ~AnalysisState ()
 
 AnalysisState (ProgramPoint point)
 Create the analysis state at the given program point. More...
 
ProgramPoint getPoint () const
 Returns the program point this state is located at. More...
 
LLVM_DUMP_METHOD void dump () const
 
void addDependency (ProgramPoint dependent, DataFlowAnalysis *analysis)
 Add a dependency to this analysis state on a program point 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
ProgramPoint point
 The program point 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 at the given program point.

Definition at line 330 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.

◆ 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 79 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 84 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 71 of file DeadCodeAnalysis.cpp.

References allPredecessorsKnown().

◆ 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: