llvm-project/mlir
Benoit Jacob 499703e9c0 Enable ReassociatingReshapeOpConversion with "non-identity" layouts.
Enable ReassociatingReshapeOpConversion with "non-identity" layouts.

This removes an early-return in this function, which seems unnecessary and is
preventing some memref.collapse_shape from converting to LLVM (see included lit test).

It seems unnecessary because the return message says "only empty layout map is supported"
but there actually is code in this function to deal with non-empty layout maps. Maybe
it refers to an earlier state of implementation and is just out of date?

Though, there is another concern about this early return: the condition that it actually
checks, `{src,dst}MemrefType.getLayout().isIdentity()`, is not quite the same as what the
return message says, "only empty layout map is supported". Stepping through this
`getLayout().isIdentity()` code in GDB, I found that it evaluates to `.getAffineMap().isIdentity()`
which does (AffineMap.cpp:271):

```
  if (getNumDims() != getNumResults())
    return false;
```

This seems that it would always return false for memrefs of rank greater than 1 ?

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114808
2022-01-13 17:46:20 +00:00
..
cmake/modules Fix exported MLIR_TABLEGEN_EXE 2022-01-09 23:27:08 -08:00
docs [mlir] Fix reference to out of date CMake function 2022-01-13 15:26:36 +01:00
examples Fix clang-tidy issues in mlir/ (NFC) 2021-12-20 20:25:01 +00:00
include [mlir] Introduce C API for PDL dialect types 2022-01-13 15:29:01 +01:00
lib Enable ReassociatingReshapeOpConversion with "non-identity" layouts. 2022-01-13 17:46:20 +00:00
python [mlir][linalg] Improve pooling op iterator order consistency 2022-01-11 17:49:22 +00:00
test Enable ReassociatingReshapeOpConversion with "non-identity" layouts. 2022-01-13 17:46:20 +00:00
tools [mlir][Interfaces] Add a extraSharedClassDeclaration field 2022-01-12 14:12:08 -08:00
unittests [mlir] Add a parsePassPipeline overload that returns a new pass manager 2022-01-12 14:54:30 -08:00
utils Update mlir GDB printers 2022-01-06 22:20:25 +01:00
.clang-format
.clang-tidy Enable readability-redundant-smartptr-get in MLIR local clang-tidy config 2022-01-08 20:07:11 +00:00
CMakeLists.txt [CMake] Factor out config prefix finding logic 2022-01-07 20:16:18 +00:00
LICENSE.TXT
README.md

README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.