[mlir][Shape] Allow shape.split_at to return extent tensors and lower it to std.subtensor
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 8 Mar 2021 14:23:28 +0000 (15:23 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 8 Mar 2021 15:48:05 +0000 (16:48 +0100)
commit42c195f0ec8f2d9236b237c5ad2c6f3ca9b4184c
tree02dafb3934b2f814c0bbb9bb168e335dc37a3f1b
parentc4542005dae203dc4cb4e4be22628d4e24b4d5b6
[mlir][Shape] Allow shape.split_at to return extent tensors and lower it to std.subtensor

split_at can return an error if the split index is out of bounds. If the
user knows that the index can never be out of bounds it's safe to use
extent tensors. This has a straight-forward lowering to std.subtensor.

Differential Revision: https://reviews.llvm.org/D98177
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
mlir/test/Conversion/ShapeToStandard/shape-to-standard.mlir