Skip to content

Commit

Permalink
[mlir] allow overriding visitRegionSuccessors (#125268)
Browse files Browse the repository at this point in the history
This PR enables overriding AbstractSparseForwardDataFlowAnalysis::visitRegionSuccessors to control precisely how the region successors of `branch` are visited. For example in order to precisely control the order in which predecessor operand lattices are propagated from. An override is responsible for visiting all the known predecessors and propagating therefrom.
  • Loading branch information
makslevental authored Jan 31, 2025
1 parent d9c9326 commit ffe3129
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,15 @@ class AbstractSparseForwardDataFlowAnalysis : public DataFlowAnalysis {
/// operation `branch`, which can either be the entry block of one of the
/// regions or the parent operation itself, and set either the argument or
/// parent result lattices.
void visitRegionSuccessors(ProgramPoint *point,
RegionBranchOpInterface branch,
RegionBranchPoint successor,
ArrayRef<AbstractSparseLattice *> lattices);
/// This method can be overridden to control precisely how the region
/// successors of `branch` are visited. For example in order to precisely
/// control the order in which predecessor operand lattices are propagated
/// from. An override is responsible for visiting all the known predecessors
/// and propagating therefrom.
virtual void
visitRegionSuccessors(ProgramPoint *point, RegionBranchOpInterface branch,
RegionBranchPoint successor,
ArrayRef<AbstractSparseLattice *> lattices);
};

//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit ffe3129

Please sign in to comment.