diff options
| author | Pierre Oechsel <pierre.oechsel@gmail.com> | 2020-04-15 18:31:22 +0200 |
|---|---|---|
| committer | Alex Zinenko <zinenko@google.com> | 2020-04-15 18:39:30 +0200 |
| commit | efcf0985eef69127af0e5576f5977b0bb3f1a4a8 (patch) | |
| tree | 509dd2a1c658b9c5f84d0992a0133402061b3e96 /lldb/packages/Python/lldbsuite/test/configuration.py | |
| parent | 1a7c6b23fcbbc09c02b655697cf5830634392bef (diff) | |
| download | llvm-efcf0985eef69127af0e5576f5977b0bb3f1a4a8.zip llvm-efcf0985eef69127af0e5576f5977b0bb3f1a4a8.tar.gz llvm-efcf0985eef69127af0e5576f5977b0bb3f1a4a8.tar.bz2 | |
[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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py')
0 files changed, 0 insertions, 0 deletions
