[Mlir-commits] [mlir] Fix int range analysis (PR #192235)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Apr 15 05:55:54 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.
----------------
smoothsmooth wrote:

Yes. Thanks!

https://github.com/llvm/llvm-project/pull/192235


More information about the Mlir-commits mailing list