[mlir] Drop reliance of SliceAnalysis on specific ops.
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 15 Feb 2021 21:44:44 +0000 (21:44 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Tue, 16 Feb 2021 06:34:32 +0000 (06:34 +0000)
commitd01ea0edaa2e38e1345dc484f8b74e0e53d3245b
tree64e8b46ce553afd7598554a2b05369bc5bcae04f
parent11bf7da64a11dbae422ff322f629be6950f9bfb7
[mlir] Drop reliance of SliceAnalysis on specific ops.

SliceAnalysis originally was developed in the context of affine.for within mlfunc.
It predates the notion of region.
This revision updates it to not hardcode specific ops like scf::ForOp.
When rooted at an op, the behavior of the slice computation changes as it recurses into the regions of the op. This does not support gathering all values transitively depending on a loop induction variable anymore.
Additional variants rooted at a Value are added to also support the existing behavior.

Differential revision: https://reviews.llvm.org/D96702
mlir/include/mlir/Analysis/SliceAnalysis.h
mlir/lib/Analysis/SliceAnalysis.cpp
mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp