llvm-project/mlir
Nicolas Vasilache f202d32216 [mlir][SCF] Add canonicalization pattern for scf::For to eliminate yields that just forward.
For instance:
```
func @for_yields_3(%lb : index, %ub : index, %step : index) -> (i32, i32, i32) {
  %a = call @make_i32() : () -> (i32)
  %b = call @make_i32() : () -> (i32)
  %r:3 = scf.for %i = %lb to %ub step %step iter_args(%0 = %a, %1 = %a, %2 = %b) -> (i32, i32, i32) {
    %c = call @make_i32() : () -> (i32)
    scf.yield %0, %c, %2 : i32, i32, i32
  }
  return %r#0, %r#1, %r#2 : i32, i32, i32
}
```

Canonicalizes as:
```
  func @for_yields_3(%arg0: index, %arg1: index, %arg2: index) -> (i32, i32, i32) {
    %0 = call @make_i32() : () -> i32
    %1 = call @make_i32() : () -> i32
    %2 = scf.for %arg3 = %arg0 to %arg1 step %arg2 iter_args(%arg4 = %0) -> (i32) {
      %3 = call @make_i32() : () -> i32
      scf.yield %3 : i32
    }
    return %0, %2, %1 : i32, i32, i32
  }
```

Differential Revision: https://reviews.llvm.org/D90745
2020-11-04 11:36:27 +00:00
..
cmake/modules [MLIR] Add support for defining Types in tblgen 2020-10-14 00:32:18 +00:00
docs [MLIR] Move eraseArguments and eraseResults to FunctionLike 2020-11-03 16:53:46 -07:00
examples Make the implicit nesting behavior of the PassManager user-controllable and default to false 2020-11-03 11:17:44 +00:00
include [mlir][SCF] Add canonicalization pattern for scf::For to eliminate yields that just forward. 2020-11-04 11:36:27 +00:00
integration_test [mlir][vector] Improve vector distribute integration test and fix block distribution 2020-10-29 14:54:53 -07:00
lib [mlir][SCF] Add canonicalization pattern for scf::For to eliminate yields that just forward. 2020-11-04 11:36:27 +00:00
test [mlir][SCF] Add canonicalization pattern for scf::For to eliminate yields that just forward. 2020-11-04 11:36:27 +00:00
tools Add a basic C API for the MLIR PassManager as well as a basic TableGen backend for creating passes 2020-11-04 06:36:31 +00:00
unittests Make the implicit nesting behavior of the PassManager user-controllable and default to false 2020-11-03 11:17:44 +00:00
utils [mlir] Fix TypeID lookup in GDB pretty printers. 2020-10-27 07:12:32 +01:00
.clang-format
.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 Enable -Werror-implicit-function-declaration by default (NFC) 2020-11-04 06:36:32 +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.