[mlir] Allow overriding AbstractDenseDataFlowAnalysis::visitOperation
authorTom Eccles <tom.eccles@arm.com>
Fri, 23 Dec 2022 21:03:14 +0000 (21:03 +0000)
committerTom Eccles <tom.eccles@arm.com>
Wed, 4 Jan 2023 10:23:40 +0000 (10:23 +0000)
commit5bedd675d741b177606dae9f13cc7c1531b6b954
treef10e1d21258c0a9e1ff7c2ed6680c5f4ac295e08
parentec48682ce9f61d056361c5095f21e930b8365661
[mlir] Allow overriding AbstractDenseDataFlowAnalysis::visitOperation

AbstractDenseDataFlowAnalysis::visitOperation controls how the dataflow
analysis proceeds around control flow. In particular, conservative
assumptions are made about call operations which can prevent some
analysis from succeeding.

The motivating case for this change is https://reviews.llvm.org/D140415,
for which it is correct and necessary for the lattice to be preserved
after call operations.

Some renaming was necessary to avoid confusion with
DenseDataFlowAnalysis::visitOperation.
AbstractDenseDataFlowAnalysis::visitRegionBranchOperation and
DenseDataFlowAnalysis::visitOperationImpl are also made protected
to allow implementation of AbstractDenseDataFlowAnalysis::visitOperation,
although I did not need these to be virtual.

Differential Revision: https://reviews.llvm.org/D140879
mlir/include/mlir/Analysis/DataFlow/DenseAnalysis.h
mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp