[mlir] support reductions in loop to std conversion
authorAlex Zinenko <zinenko@google.com>
Tue, 3 Mar 2020 12:21:51 +0000 (13:21 +0100)
committerAlex Zinenko <zinenko@google.com>
Tue, 3 Mar 2020 17:21:13 +0000 (18:21 +0100)
commit8ba8ab8c95fb185d722842bf78053a8dad6181cd
treec0908fc10d909529e2cd39a94f6a50e32cd2a3d6
parentd93371238e7f5d5f9c506a88cf4f05f8dea9d008
[mlir] support reductions in loop to std conversion

Summary:
Introduce support for converting loop.for operations with loop-carried values
to a CFG in the standard dialect. This is achieved by passing loop-carried
values as block arguments to the loop condition block. This block dominates
both the loop body and the block immediately following the loop, so the
arguments of this block are remain visible there.

Differential Revision: https://reviews.llvm.org/D75513
mlir/lib/Conversion/LoopToStandard/ConvertLoopToStandard.cpp
mlir/test/Conversion/convert-to-cfg.mlir