[mlir][linalg][NFC] Make reshape folding control more fine grain
authorthomasraoux <thomasraoux@google.com>
Thu, 6 May 2021 14:28:09 +0000 (07:28 -0700)
committerthomasraoux <thomasraoux@google.com>
Thu, 6 May 2021 17:11:39 +0000 (10:11 -0700)
commit52525cb20ff300d634453fdb3986adf4801f205c
tree1af44dee54941ceab94407866b2099a68645d853
parentb198b9b8974b19c9e8493f8d70c85ac54182597a
[mlir][linalg][NFC] Make reshape folding control more fine grain

This expose a lambda control instead of just a boolean to control unit
dimension folding.
This however gives more control to user to pick a good heuristic.
Folding reshapes helps fusion opportunities but may generate sub-optimal
generic ops.

Differential Revision: https://reviews.llvm.org/D101917
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp