Skip to content

Commit ffe3129

Browse files
authored
[mlir] allow overriding visitRegionSuccessors (llvm#125268)
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.
1 parent d9c9326 commit ffe3129

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,15 @@ class AbstractSparseForwardDataFlowAnalysis : public DataFlowAnalysis {
255255
/// operation `branch`, which can either be the entry block of one of the
256256
/// regions or the parent operation itself, and set either the argument or
257257
/// parent result lattices.
258-
void visitRegionSuccessors(ProgramPoint *point,
259-
RegionBranchOpInterface branch,
260-
RegionBranchPoint successor,
261-
ArrayRef<AbstractSparseLattice *> lattices);
258+
/// This method can be overridden to control precisely how the region
259+
/// successors of `branch` are visited. For example in order to precisely
260+
/// control the order in which predecessor operand lattices are propagated
261+
/// from. An override is responsible for visiting all the known predecessors
262+
/// and propagating therefrom.
263+
virtual void
264+
visitRegionSuccessors(ProgramPoint *point, RegionBranchOpInterface branch,
265+
RegionBranchPoint successor,
266+
ArrayRef<AbstractSparseLattice *> lattices);
262267
};
263268

264269
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)