[MLIR][LinAlg] Start detensoring implementation.
authorKareemErgawy-TomTom <kareem.ergawy@gmail.com>
Tue, 16 Feb 2021 06:42:41 +0000 (07:42 +0100)
committerKareemErgawy-TomTom <kareem.ergawy@gmail.com>
Tue, 23 Feb 2021 07:27:58 +0000 (08:27 +0100)
commit67e0d58de4d338add132838810db70218f1064d8
treed0ebc65b08ee6e92ad3c410e76931a62c6912a09
parentc61e511f38c8bbcf1b3a35cf1f63aa9f51b92679
[MLIR][LinAlg] Start detensoring implementation.

This commit is the first baby step towards detensoring in
linalg-on-tensors.

Detensoring is the process through which a tensor value is convereted to one
or potentially more primitive value(s). During this process, operations with
such detensored operands are also converted to an equivalen form that works
on primitives.

The detensoring process is driven by linalg-on-tensor ops. In particular, a
linalg-on-tensor op is checked to see whether *all* its operands can be
detensored. If so, those operands are converted to thier primitive
counterparts and the linalg op is replaced by an equivalent op that takes
those new primitive values as operands.

This works towards handling github/google/iree#1159.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96271
mlir/include/mlir/Dialect/Linalg/Passes.h
mlir/include/mlir/Dialect/Linalg/Passes.td
mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp [new file with mode: 0644]
mlir/test/Dialect/Linalg/detensorized_0d.mlir [new file with mode: 0644]