[Mlir-commits] [mlir] ffe3129 - [mlir] allow overriding visitRegionSuccessors (#125268)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jan 31 12:56:04 PST 2025
Author: Maksim Levental
Date: 2025-01-31T15:55:59-05:00
New Revision: ffe3129e9bdc146ee4d91e849173d1c64b1ae974
URL: https://github.com/llvm/llvm-project/commit/ffe3129e9bdc146ee4d91e849173d1c64b1ae974
DIFF: https://github.com/llvm/llvm-project/commit/ffe3129e9bdc146ee4d91e849173d1c64b1ae974.diff
LOG: [mlir] allow overriding visitRegionSuccessors (#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.
Added:
Modified:
mlir/include/mlir/Analysis/DataFlow/SparseAnalysis.h
Removed:
################################################################################
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<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);
};
//===----------------------------------------------------------------------===//
More information about the Mlir-commits
mailing list