forked from OSchip/llvm-project
efcf0985ee
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 |
||
---|---|---|
.. | ||
Analysis | ||
Conversion | ||
Dialect | ||
EDSC | ||
Examples | ||
IR | ||
Pass | ||
SDBM | ||
Target | ||
Transforms | ||
Unit | ||
lib | ||
mlir-cpu-runner | ||
mlir-cuda-runner | ||
mlir-linalg-ods-gen | ||
mlir-opt | ||
mlir-tblgen | ||
mlir-vulkan-runner | ||
APITest.h | ||
CMakeLists.txt | ||
lit.cfg.py | ||
lit.site.cfg.py.in |