[Mlir-commits] [mlir] Fix int range analysis (PR #192235)
Mehdi Amini
llvmlistbot at llvm.org
Wed Apr 15 05:34:32 PDT 2026
================
@@ -137,6 +137,87 @@ LogicalResult IntegerRangeAnalysis::visitOperation(
return success();
}
+void IntegerRangeAnalysis::visitRegionSuccessors(
+ ProgramPoint *point, RegionBranchOpInterface branch,
+ RegionSuccessor successor,
+ ArrayRef<AbstractSparseLattice *> lattices) {
+
+ Operation *branchOp = branch.getOperation();
+ bool isLoop = isa<LoopLikeOpInterface>(branchOp);
+
+ // For non-loop regions (scf.if, scf.index_switch, etc.), delegate to
+ // the upstream implementation — no visit cap needed.
+ if (!isLoop) {
+ SparseForwardDataFlowAnalysis::visitRegionSuccessors(
+ point, branch, successor, lattices);
+ return;
+ }
+
+ // For loops: replicate upstream logic with a visit cap.
----------------
joker-eph wrote:
```suggestion
// For loops: replicate base class implementation with a visit cap.
```
This is what you meant with "upstream" right?
https://github.com/llvm/llvm-project/pull/192235
More information about the Mlir-commits
mailing list