[MLIR][LinAlg] Implement detensoring cost-modelling.
authorKareemErgawy-TomTom <kareem.ergawy@gmail.com>
Tue, 13 Apr 2021 06:26:12 +0000 (08:26 +0200)
committerKareemErgawy-TomTom <kareem.ergawy@gmail.com>
Tue, 13 Apr 2021 07:07:18 +0000 (09:07 +0200)
commitaa6eb2af10094e427827343b67b25d606dde10b7
tree68b7608ed1596aeb3c6193a51d598b41ddc99e8a
parentcc86a8aa53a316860da8c32b4817efd2609bd96f
[MLIR][LinAlg] Implement detensoring cost-modelling.

This patch introduces the neccessary infrastructure changes to implement
cost-modelling for detensoring. In particular, it introduces the
following changes:
- An extension to the dialect conversion framework to selectively
convert sub-set of non-entry BB arguments.
- An extension to branch conversion pattern to selectively convert
sub-set of a branche's operands.
- An interface for detensoring cost-modelling.
- 2 simple implementations of 2 different cost models.

This sets the stage to explose cost-modelling for detessoring in an
easier way. We still need to come up with better cost models.

Reviewed By: silvas

Differential Revision: https://reviews.llvm.org/D99945
12 files changed:
mlir/include/mlir/Dialect/StandardOps/Transforms/FuncConversions.h
mlir/include/mlir/Transforms/DialectConversion.h
mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp
mlir/lib/Transforms/Utils/DialectConversion.cpp
mlir/test/Dialect/Linalg/detensorize_if.mlir [new file with mode: 0644]
mlir/test/Dialect/Linalg/detensorize_trivial.mlir [new file with mode: 0644]
mlir/test/Dialect/Linalg/detensorize_while.mlir [new file with mode: 0644]
mlir/test/Dialect/Linalg/detensorize_while_failure.mlir [new file with mode: 0644]
mlir/test/Dialect/Linalg/detensorize_while_pure_cf.mlir [new file with mode: 0644]
mlir/test/Dialect/Linalg/detensorized_0d.mlir
mlir/test/Dialect/Linalg/detensorized_while.mlir [deleted file]