|
MLIR 23.0.0git
|
Integer divisibility analysis determines, for each integer-typed SSA value, a divisor that the value is guaranteed to be a multiple of. More...
#include "mlir/Analysis/DataFlow/IntegerDivisibilityAnalysis.h"
Public Member Functions | |
| void | setToEntryState (IntegerDivisibilityLattice *lattice) override |
| At an entry point, set the lattice to the most pessimistic state, indicating that no further reasoning can be done. | |
| LogicalResult | visitOperation (Operation *op, ArrayRef< const IntegerDivisibilityLattice * > operands, ArrayRef< IntegerDivisibilityLattice * > results) override |
| Visit an operation, invoking the transfer function. | |
| void | visitNonControlFlowArguments (Operation *op, const RegionSuccessor &successor, ValueRange successorInputs, ArrayRef< IntegerDivisibilityLattice * > argLattices) override |
| Visit block arguments or operation results of an operation with region control-flow for which values are not defined by region control-flow. | |
| SparseForwardDataFlowAnalysis (DataFlowSolver &solver) | |
| Public Member Functions inherited from mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice > | |
| SparseForwardDataFlowAnalysis (DataFlowSolver &solver) | |
| virtual void | visitExternalCall (CallOpInterface call, ArrayRef< const IntegerDivisibilityLattice * > argumentLattices, ArrayRef< IntegerDivisibilityLattice * > resultLattices) |
| Visit a call operation to an externally defined function given the lattices of its arguments. | |
| Public Member Functions inherited from mlir::dataflow::AbstractSparseForwardDataFlowAnalysis | |
| LogicalResult | initialize (Operation *top) override |
| Initialize the analysis by visiting every owner of an SSA value: all operations and blocks. | |
| LogicalResult | visit (ProgramPoint *point) override |
| Visit a program point. | |
| Public Member Functions inherited from mlir::DataFlowAnalysis | |
| virtual | ~DataFlowAnalysis () |
| DataFlowAnalysis (DataFlowSolver &solver) | |
| Create an analysis with a reference to the parent solver. | |
| virtual void | initializeEquivalentLatticeAnchor (Operation *top) |
| Initialize lattice anchor equivalence class from the provided top-level operation. | |
| TypeID | getTypeID () const |
| Return the TypeID of the concrete analysis class. | |
Additional Inherited Members | |
| Protected Member Functions inherited from mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice > | |
| IntegerDivisibilityLattice * | getLatticeElement (Value value) override |
| Get the lattice element for a value. | |
| const IntegerDivisibilityLattice * | getLatticeElementFor (ProgramPoint *point, Value value) |
| Get the lattice element for a value and create a dependency on the provided program point. | |
| void | setAllToEntryStates (ArrayRef< IntegerDivisibilityLattice * > lattices) |
| Protected Member Functions inherited from mlir::dataflow::AbstractSparseForwardDataFlowAnalysis | |
| AbstractSparseForwardDataFlowAnalysis (DataFlowSolver &solver) | |
| const AbstractSparseLattice * | getLatticeElementFor (ProgramPoint *point, Value value) |
| Get a read-only lattice element for a value and add it as a dependency to a program point. | |
| virtual void | setToEntryState (AbstractSparseLattice *lattice)=0 |
| Set the given lattice element(s) at control flow entry point(s). | |
| void | setAllToEntryStates (ArrayRef< AbstractSparseLattice * > lattices) |
| void | join (AbstractSparseLattice *lhs, const AbstractSparseLattice &rhs) |
| Join the lattice element and propagate and update if it changed. | |
| virtual LogicalResult | visitCallOperation (CallOpInterface call, ArrayRef< const AbstractSparseLattice * > operandLattices, ArrayRef< AbstractSparseLattice * > resultLattices) |
| Visits a call operation. | |
| virtual void | visitCallableOperation (CallableOpInterface callable, ArrayRef< AbstractSparseLattice * > argLattices) |
| Visits a callable operation. | |
| Protected Member Functions inherited from mlir::DataFlowAnalysis | |
| void | addDependency (AnalysisState *state, ProgramPoint *point) |
| Create a dependency between the given analysis state and lattice anchor on this analysis. | |
| void | propagateIfChanged (AnalysisState *state, ChangeResult changed) |
| Propagate an update to a state if it changed. | |
| template<typename AnchorT> | |
| void | registerAnchorKind () |
| Register a custom lattice anchor class. | |
| template<typename AnchorT, typename... Args> | |
| AnchorT * | getLatticeAnchor (Args &&...args) |
| Get or create a custom lattice anchor. | |
| template<typename StateT, typename AnchorT> | |
| void | unionLatticeAnchors (AnchorT anchor, AnchorT other) |
| Union input anchors under the given state. | |
| template<typename StateT, typename AnchorT> | |
| StateT * | getOrCreate (AnchorT anchor) |
| Get the analysis state associated with the lattice anchor. | |
| template<typename StateT, typename AnchorT> | |
| const StateT * | getOrCreateFor (ProgramPoint *dependent, AnchorT anchor) |
| Get a read-only analysis state for the given point and create a dependency on dependent. | |
| ProgramPoint * | getProgramPointBefore (Operation *op) |
| Get a uniqued program point instance. | |
| ProgramPoint * | getProgramPointBefore (Block *block) |
| ProgramPoint * | getProgramPointAfter (Operation *op) |
| ProgramPoint * | getProgramPointAfter (Block *block) |
| const DataFlowConfig & | getSolverConfig () const |
| Return the configuration of the solver used for this analysis. | |
Integer divisibility analysis determines, for each integer-typed SSA value, a divisor that the value is guaranteed to be a multiple of.
It uses operations that implement InferIntDivisibilityOpInterface and also sets the divisibility of induction variables of loops with known lower bounds and steps.
This analysis depends on DeadCodeAnalysis, and will be a silent no-op if DeadCodeAnalysis is not loaded in the same solver context.
Definition at line 37 of file IntegerDivisibilityAnalysis.h.
|
overridevirtual |
At an entry point, set the lattice to the most pessimistic state, indicating that no further reasoning can be done.
Implements mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice >.
Definition at line 27 of file IntegerDivisibilityAnalysis.cpp.
References mlir::IntegerDivisibility::getMinDivisibility(), mlir::dataflow::Lattice< ValueT >::join(), and mlir::DataFlowAnalysis::propagateIfChanged().
|
inlineexplicit |
Definition at line 307 of file SparseAnalysis.h.
|
overridevirtual |
Visit block arguments or operation results of an operation with region control-flow for which values are not defined by region control-flow.
This function tries to infer the divisibility of loop induction variables based on known loop bounds and steps.
Reimplemented from mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice >.
Definition at line 79 of file IntegerDivisibilityAnalysis.cpp.
References mlir::getConstantIntValue(), mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice >::getLatticeElement(), mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice >::getLatticeElementFor(), mlir::IntegerDivisibility::getMinDivisibility(), mlir::DataFlowAnalysis::getProgramPointBefore(), mlir::ConstantIntDivisibility::getUnion(), mlir::dataflow::Lattice< ValueT >::getValue(), mlir::IntegerDivisibility::getValue(), mlir::IntegerDivisibility::isUninitialized(), mlir::dataflow::Lattice< ValueT >::join(), mlir::DataFlowAnalysis::propagateIfChanged(), mlir::ConstantIntDivisibility::sdiv(), mlir::ConstantIntDivisibility::udiv(), and mlir::dataflow::SparseForwardDataFlowAnalysis< StateT >::visitNonControlFlowArguments().
|
overridevirtual |
Visit an operation, invoking the transfer function.
Implements mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice >.
Definition at line 33 of file IntegerDivisibilityAnalysis.cpp.
References mlir::IntegerDivisibility::getMinDivisibility(), mlir::Operation::getResults(), mlir::Value::getUsers(), mlir::dataflow::Lattice< ValueT >::getValue(), mlir::IntegerDivisibility::isUninitialized(), mlir::dataflow::Lattice< ValueT >::join(), mlir::DataFlowAnalysis::propagateIfChanged(), result, mlir::dataflow::SparseForwardDataFlowAnalysis< IntegerDivisibilityLattice >::setAllToEntryStates(), and success().