63 :
public mlir::dataflow::AbstractSparseForwardDataFlowAnalysis {
64 using Base = mlir::dataflow::AbstractSparseForwardDataFlowAnalysis;
72 mlir::LogicalResult
initialize(mlir::Operation *top)
override;
76 mlir::LogicalResult
visit(mlir::ProgramPoint *point)
override;
93 mlir::LogicalResult initializeRecursivelyInProgramOrder(mlir::Operation *op);
96 mlir::LogicalResult visitOperationDuringInitialization(mlir::Operation *op);
99 bool isOperationLive(mlir::Operation *op);
103 llvm::SmallVector<const AbstractSparseLattice *, 4>
104 collectOperandLatticesAndSubscribe(mlir::Operation *op);
107 mlir::LogicalResult visitZeroResultCallOperation(
108 mlir::CallOpInterface call, mlir::ArrayRef<const AbstractSparseLattice *> operandLattices
114 mlir::LogicalResult visitZeroResultOperation(mlir::Operation *op);
128 std::is_base_of<AbstractSparseLattice, StateT>::value,
129 "analysis state class expected to subclass AbstractSparseLattice"
140 mlir::Operation *op, mlir::ArrayRef<const StateT *> operands, mlir::ArrayRef<StateT *> results
146 mlir::CallOpInterface , mlir::ArrayRef<const StateT *> ,
147 mlir::ArrayRef<StateT *> resultLattices
158 mlir::Operation * ,
const mlir::RegionSuccessor & ,
159 mlir::ValueRange nonSuccessorInputs, mlir::ArrayRef<StateT *> nonSuccessorInputLattices
161 assert(nonSuccessorInputs.size() == nonSuccessorInputLattices.size() &&
"size mismatch");
173 return static_cast<const StateT *
>(
174 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::getLatticeElementFor(point, value)
181 mlir::dataflow::AbstractSparseForwardDataFlowAnalysis::setAllToEntryStates(
189 mlir::LogicalResult visitOperationImpl(
190 mlir::Operation *op, mlir::ArrayRef<const AbstractSparseLattice *> operandLattices,
191 mlir::ArrayRef<AbstractSparseLattice *> resultLattices
195 {
reinterpret_cast<const StateT *
const *
>(operandLattices.begin()), operandLattices.size()},
196 {
reinterpret_cast<StateT *
const *
>(resultLattices.begin()), resultLattices.size()}
200 void visitExternalCallImpl(
201 mlir::CallOpInterface call, mlir::ArrayRef<const AbstractSparseLattice *> argumentLattices,
202 mlir::ArrayRef<AbstractSparseLattice *> resultLattices
206 {
reinterpret_cast<const StateT *
const *
>(argumentLattices.begin()),
207 argumentLattices.size()},
208 {
reinterpret_cast<StateT *
const *
>(resultLattices.begin()), resultLattices.size()}
212 void visitNonControlFlowArgumentsImpl(
213 mlir::Operation *op,
const mlir::RegionSuccessor &successor,
214 mlir::ValueRange nonSuccessorInputs,
215 mlir::ArrayRef<AbstractSparseLattice *> nonSuccessorInputLattices
218 op, successor, nonSuccessorInputs,
219 {
reinterpret_cast<StateT *
const *
>(nonSuccessorInputLattices.begin()),
220 nonSuccessorInputLattices.size()}
virtual void visitNonControlFlowArguments(mlir::Operation *, const mlir::RegionSuccessor &, mlir::ValueRange nonSuccessorInputs, mlir::ArrayRef< StateT * > nonSuccessorInputLattices)
Given an operation with possible region control-flow, the lattices of the operands,...