MLIR
20.0.0git
|
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"
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... | |
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.
|
inline |
Returns true if all predecessors are known.
Definition at line 101 of file DeadCodeAnalysis.h.
Referenced by print().
|
inline |
Create the analysis state on the given lattice anchor.
Definition at line 452 of file DataFlowFramework.h.
Get the known predecessors.
Definition at line 110 of file DeadCodeAnalysis.h.
Referenced by print().
|
inline |
Get the successor inputs from a predecessor.
Definition at line 115 of file DeadCodeAnalysis.h.
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().
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().
|
overridevirtual |
Print the known predecessors.
Implements mlir::AnalysisState.
Definition at line 74 of file DeadCodeAnalysis.cpp.
References allPredecessorsKnown(), and getKnownPredecessors().
|
inline |
Indicate that there are potentially unknown predecessors.
Definition at line 104 of file DeadCodeAnalysis.h.
References mlir::Change, and mlir::NoChange.