Error in the sparse backward dataflow analysis
Currently, in the sparse backward dataflow analysis, data from the results
of an op implementing RegionBranchOpInterface is considered to flow
into the operands of every op that does not implement the
RegionBranchTerminatorOpInterface but is return-like and present
in a region of the former. It is thus also expected that the number of
results of the former be equal to the number of operands in the latter.
This understanding of dataflow is incorrect and thus this expectation is also not justified. This incorrect understanding needs to be fixed.
These return-like ops should instead be handled just like the ops
implementing the RegionBranchTerminatorOpInterface, which means
that, if this op has a region A whose successors are regions B, C,
and D, then data flows from the arguments (successor inputs) of B,
C, and D to the corresponding successor operands of this op.
The above fix should also be propagated to liveness analysis that currently relies on the incorrect implementation of the sparse backward dataflow analysis framework and should correct some incorrect assumptions made in it.
Signed-off-by: Srishti Srivastava [email protected]
@llvm/issue-subscribers-mlir
Upstream patch under review: https://reviews.llvm.org/D156376
Patch submitted. Thus, closing the issue.