From e02efa659678a21a66fcfa2caa4b8e85393c8e13 Mon Sep 17 00:00:00 2001 From: Maksim Levental Date: Fri, 31 Jan 2025 13:54:17 -0500 Subject: [PATCH] [mlir] NFC: void visitRegionSuccessors 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. --- .../include/mlir/Analysis/DataFlow/SparseAnalysis.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h b/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h index 387b9ee707179b..b9cb549a0e4384 100644 --- a/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h +++ b/mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h @@ -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 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 lattices); }; //===----------------------------------------------------------------------===//