[MLIR][Slicing] Add utils for computing slices.
authorNicolas Vasilache <ntv@google.com>
Wed, 21 Nov 2018 20:34:10 +0000 (12:34 -0800)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 21:08:02 +0000 (14:08 -0700)
commit5c16564bca43a8fc3823680789c796e3cac1e7d7
treec9883925232f43ffd15f6f022763007f368ccffc
parentcff7789a49ba82b188d702f649db705901ef58b1
[MLIR][Slicing] Add utils for computing slices.

This CL adds tooling for computing slices as an independent CL.
The first consumer of this analysis will be super-vector materialization in a
followup CL.

In particular, this adds:
1. a getForwardStaticSlice function with documentation, example and a
standalone unit test;
2. a getBackwardStaticSlice function with documentation, example and a
standalone unit test;
3. a getStaticSlice function with documentation, example and a standalone unit
test;
4. a topologicalSort function that is exercised through the getStaticSlice
unit test.

The getXXXStaticSlice functions take an additional root (resp. terminators)
parameter which acts as a boundary that the transitive propagation algorithm
is not allowed to cross.

PiperOrigin-RevId: 222446208
mlir/include/mlir/Analysis/SliceAnalysis.h [new file with mode: 0644]
mlir/include/mlir/StandardOps/StandardOps.h
mlir/include/mlir/Support/Functional.h
mlir/lib/Analysis/SliceAnalysis.cpp [new file with mode: 0644]
mlir/lib/Analysis/VectorAnalysis.cpp
mlir/lib/Transforms/Vectorization/VectorizerTestPass.cpp
mlir/test/Transforms/slicing_utils.mlir [new file with mode: 0644]
mlir/test/Transforms/vector_utils.mlir