llvm-project/mlir
Hanhan Wang 6dd696ae4f [mlir][Linalg] Extend fusion to support WAW atm on buffers.
Summary:
The RAW fusion happens only if the produecer block dominates the consumer block.
The WAW pattern also works with the precondition. I.e., if a producer can
dominate the consumer, they can fairly fuse together.

Since they are all tilable, we can think the pattern like this way:

Input:
```
linalg_op1 view

tile_loop
  subview_2
  linalg_op2 subview_2
```

Tile the first Linalg op as same as the second Linalg.
```
tile_loop
  subview_1
  linalg_op1 subview_1

tile_loop
  subview_2
  liangl_op2 subview_2
```

Since the first Linalg op is tilable in the same way and the computation are
independently, it's fair to fuse it with the second Linalg op.
```
tile_loop
  subview_1
  linalg_op1 subview_1
  linalg_op2 subview_2
```

In short, this patch includes:
- Handling both RAW and WAW pattern.
- Adding a interface method to get input and output buffers.
- Exposing a method to get a StringRef of a dependency type.
- Fixing existing WAW tests and add one more use case: initialize the buffer
  before conv op.

Differential Revision: https://reviews.llvm.org/D76897
2020-03-31 21:33:50 -07:00
..
cmake/modules [mlir] Revamp operation documentation generation 2020-03-24 12:05:18 -07:00
docs [mlir][spirv] Include SPIR-V op definitions in main SPIR-V doc 2020-03-31 18:29:17 -04:00
examples [mlir][NFC] Cleanup AffineOps directory structure 2020-03-20 14:23:43 -07:00
include [mlir][Linalg] Extend fusion to support WAW atm on buffers. 2020-03-31 21:33:50 -07:00
lib [mlir][Linalg] Extend fusion to support WAW atm on buffers. 2020-03-31 21:33:50 -07:00
test [mlir][Linalg] Extend fusion to support WAW atm on buffers. 2020-03-31 21:33:50 -07:00
tools Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
unittests Add a flag on the context to protect against creation of operations in unregistered dialects 2020-03-30 19:37:31 +00:00
utils [mlir][spirv] Change op doc description autogen separator 2020-03-31 15:28:06 -04:00
.clang-format [mlir] add .clang-format 2019-03-29 12:41:43 -07:00
.clang-tidy Fix MLIR clang-tidy: when tweaking it does not inherit from the parent 2020-03-07 17:44:21 +00:00
CMakeLists.txt [mlir] Fix cross compiling MLIR 2020-03-14 19:18:40 +00:00
LICENSE.TXT Add the Apache2 with LLVM exceptions license to MLIR 2019-12-24 00:58:06 -08:00
README.md mlir README.md: Fix the syntax 2019-12-24 13:31:07 +01:00

README.md

Multi-Level Intermediate Representation

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