[Linalg] Add a slice op
authorNicolas Vasilache <ntv@google.com>
Fri, 19 Apr 2019 19:55:34 +0000 (12:55 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:01:10 +0000 (22:01 -0700)
commit0b47f740376e273a8be42fd0ae7b103623a61af5
tree004cfa15055cb713bc213bb219f75693e32c09b6
parent1d5dc840e7678af1f64b772f4d838e44fa10bef7
[Linalg] Add a slice op

    This CL adds a linalg.slice op with the proper roundtripping test.
    A slice op allows taking subviews that may be rank-reducing (if some indexing is of index type) or not (if all indexings are of linalg.range type).

    A slice must be constructed directly from a base view (no chains of slices may exist in the IR). Helper functions that fold will be provided for construction if/when necessary.

    This also renames base_view to view.

--

PiperOrigin-RevId: 244406827
mlir/include/mlir/Linalg/LinalgOps.h
mlir/include/mlir/Linalg/LinalgTypes.h
mlir/lib/Linalg/LinalgOps.cpp
mlir/lib/Linalg/LinalgTypes.cpp
mlir/test/Linalg/roundtrip.mlir