[mlir] Refactor the forward dataflow propagation in SCCP into a generic framework
authorRiver Riddle <riddleriver@gmail.com>
Tue, 27 Apr 2021 02:33:50 +0000 (19:33 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 27 Apr 2021 02:39:46 +0000 (19:39 -0700)
commitd07c90e39550e6b708d9bd262697a4b92bae860a
treeed35bb94627d53f5ce32b7b7bf96440692165cb3
parent016092d786f226f403fce5b5d0888dfa939b3f21
[mlir] Refactor the forward dataflow propagation in SCCP into a generic framework

This revision takes the forward value propagation engine in SCCP and refactors it into a more generalized forward dataflow analysis framework. This framework allows for propagating information about values across the various control flow constructs in MLIR, and removes the need for users to reinvent the traversal (often not as completely). There are a few aspects of the traversal, that were conservative for SCCP, that should be relaxed to support the needs of different value analyses. To keep this revision simple, these conservative behaviors will be left in (Note that this won't produce an incorrect result, but may produce more conservative results than necessary in certain edge cases. e.g. region entry arguments for non-region branch interface operations). The framework also only focuses on computing lattices for values, given the SCCP origins, but this is something to relax as needed in the future.

Given that this logic is already in SCCP, a majority of this commit is NFC. The more interesting parts are the interface glue that clients interact with.

Differential Revision: https://reviews.llvm.org/D100915
mlir/docs/Tutorials/DataFlowAnalysis.md [new file with mode: 0644]
mlir/include/mlir/Analysis/DataFlowAnalysis.h [new file with mode: 0644]
mlir/lib/Analysis/CMakeLists.txt
mlir/lib/Analysis/DataFlowAnalysis.cpp [new file with mode: 0644]
mlir/lib/Transforms/SCCP.cpp