[Mlir-commits] [mlir] [mlir][dataflow] Delete visitRegionSuccessors not run code (NFC) (PR #174790)
Matthias Springer
llvmlistbot at llvm.org
Sat Jan 10 06:57:43 PST 2026
================
@@ -307,29 +307,20 @@ void AbstractSparseForwardDataFlowAnalysis::visitRegionSuccessors(
"expected the same number of successor inputs as operands");
unsigned firstIndex = 0;
- if (inputs.size() != lattices.size()) {
- if (!point->isBlockStart()) {
- if (!inputs.empty())
- firstIndex = cast<OpResult>(inputs.front()).getResultNumber();
- visitNonControlFlowArgumentsImpl(
----------------
matthias-springer wrote:
Actually, I now see that there is an implicit assumption built into the data flow analysis framework:
```
// The results of a region branch operation are determined by control-flow.
if (auto branch = dyn_cast<RegionBranchOpInterface>(op)) {
visitRegionSuccessors(getProgramPointAfter(branch), branch,
/*successor=*/{branch, branch->getResults()},
resultLattices);
return success();
}
```
I'm not sure if this comment is correct. We are treating block arguments and op results in a non-uniform way.
Before merging this PR, we should first clarify if op results of a `RegionBranchOpInterface` op must be successor inputs. (While I have no real-world counter-example where this would be a problem, it still seems a bit strange to me.) You found something interesting here!
https://github.com/llvm/llvm-project/pull/174790
More information about the Mlir-commits
mailing list