torch-mlir/lib
Ramiro Leal-Cavazos c9fd78988e
[NFC] Clean-up `ConvertAtenViewOp` in linalg backend (#2470)
While trying to fix a bug in the `ConvertAtenViewOp` pattern in the
linalg backend, I realized that the pattern had become quite complex and
had accumulated some dead code, making it hard to reason about.

This commit simplifies the pattern quite a bit. The main changes are:
1. All the static helper functions in the `ConvertAtenViewOp` class have
been simplified, both in their signature and their body. Each one now
performs simple calculations on arrays, and take the least number of
arguments necessary.
2. The body of [the `while`
loop](9fce566b0c/lib/Conversion/TorchToLinalg/DataMovement.cpp (L407))
inside the main pattern has been changed to work on `MutableArrayRef`
slices, to avoid having to keep track of `start` and `end` indices for
the input and output shape arrays.
3. All the heuristics used to determine the mapping between the input
and output dimensions are now in [this relatively short `if-else`
section](9fce566b0c/lib/Conversion/TorchToLinalg/DataMovement.cpp (L428-L460)),
making it easy to see what is going on.
4. Dead code was eliminated + updates to some of the documentation
comments

This commit does not add any new functionality to the
`ConvertAtenViewOp` pattern.
2023-09-26 09:20:01 -07:00
..
CAPI Add typeids to CAPI. (#2253) 2023-06-20 22:06:43 -05:00
Conversion [NFC] Clean-up `ConvertAtenViewOp` in linalg backend (#2470) 2023-09-26 09:20:01 -07:00
Dialect [MLIR][TORCH] Add device "cpu" support for aten.to.dtype_layout op (#2481) 2023-09-25 10:00:19 -04:00
RefBackend Add complex dtype support on refbackend 2023-05-11 21:29:07 +05:30
CMakeLists.txt Remove mlir-hlo (replace with stablehlo). (#2460) 2023-09-12 19:10:02 -07:00
InitAll.cpp Remove mlir-hlo (replace with stablehlo). (#2460) 2023-09-12 19:10:02 -07:00