[MLIR][SPIRVToLLVM] Conversion pattern for loop op
authorGeorge Mitenkov <georgemitenk0v@gmail.com>
Wed, 5 Aug 2020 07:09:21 +0000 (10:09 +0300)
committerGeorge Mitenkov <georgemitenk0v@gmail.com>
Wed, 5 Aug 2020 07:33:54 +0000 (10:33 +0300)
commite739648cfae21d2b564751ef0511fec9559305fa
treed9160bdba6486f04d99f5ec0e0fc6a73e3d34b2c
parentbc10888dcdda1fe80a983029bc50eec4b248cc77
[MLIR][SPIRVToLLVM] Conversion pattern for loop op

This patch introduces a conversion of `spv.loop` to LLVM dialect.
Similarly to `spv.selection`, op's control attributes are not mapped
to LLVM yet and therefore the conversion fails if the loop control is
not `None`. Also, all blocks within the loop should be reachable in
order for conversion to succeed.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D84245
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir