llvm-project/mlir
Pierre Oechsel efcf0985ee [mlir] [EDSC] Add interface for yield-for loops.
Summary:
ModelBuilder was missing an api to easily generate yield-for-loops.
This diffs implements an interface allowing to write:
```
%2:2 = loop.for %i = %start to %end step %step iter_args(%arg0 = %init0, %arg1 = %init1) -> (f32, f32) {
  %sum = addf %arg0, %arg1 : f32
  loop.yield %arg1, %sum : f32, f32
}
%3 = addf %2#0, %2#1 : f32
```

as

```
auto results =
    LoopNestBuilder(&i, start, end, step, {&arg0, &arg1},  {init0, init1})([&] {
      auto sum = arg0 + arg1;
      loop_yield(ArrayRef<ValueHandle>{arg1, sum});
    });

// Add the two values accumulated by the yield-for-loop:
ValueHandle(results[0]) + ValueHandle(results[1]);
```

Differential Revision: https://reviews.llvm.org/D78093
2020-04-15 18:39:30 +02:00
..
cmake/modules [MLIR] Fix MLIR_MAIN_[SRC|INCLUDE]_DIR variables 2020-04-12 09:29:07 +03:00
docs [mlir] LLVM dialect: support globals without linkage keyword, assuming 'external' 2020-04-15 10:58:32 +02:00
examples [mlir][NFC] Remove the STLExtras.h header file now that it has been merged into LLVM. 2020-04-14 15:14:41 -07:00
include [mlir] [EDSC] Add interface for yield-for loops. 2020-04-15 18:39:30 +02:00
lib [mlir] [EDSC] Add interface for yield-for loops. 2020-04-15 18:39:30 +02:00
test [mlir] [EDSC] Add interface for yield-for loops. 2020-04-15 18:39:30 +02:00
tools [llvm][StringExtras] Merge StringExtras from MLIR into LLVM 2020-04-14 18:57:22 -07:00
unittests [llvm][StringExtras] Merge StringExtras from MLIR into LLVM 2020-04-14 18:57:22 -07:00
utils [mlir][spirv] NFC: use Optional to replace SPV_Optional 2020-04-13 15:44: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 MLIR_MAIN_[SRC|INCLUDE]_DIR variables 2020-04-12 09:29:07 +03: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.