[PATCH] D74174: [MLIR] Allow Loop dialect IfOp and ForOp to define values

Nagy Mostafa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 15:02:22 PST 2020


nmostafa created this revision.
nmostafa added reviewers: herhut, bondhugula, ftynse.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a reviewer: nicolasvasilache.
Herald added a reviewer: rriddle.
Herald added a project: LLVM.

This patch implements the RFCs proposed here <https://llvm.discourse.group/t/rfc-modify-ifop-in-loop-dialect-to-yield-values/463> and here <https://llvm.discourse.group/t/rfc-adding-operands-and-results-to-loop-for/459/19>. 
It introduces the following changes:

- All Loop Ops region, except for ReduceOp, terminate with a YieldOp.
- YieldOp can have variadice operands that is used to return values out of IfOp and ForOp regions.
- Change IfOp and ForOp syntax and representation to define values.
- Add unit-tests and update .td documentation.

Lowering is not supported at the moment, and will be in a follow-up PR.

Thanks.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74174

Files:
  mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
  mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
  mlir/include/mlir/Dialect/LoopOps/LoopOps.td
  mlir/include/mlir/IR/OpImplementation.h
  mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
  mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
  mlir/lib/Dialect/LoopOps/LoopOps.cpp
  mlir/lib/Parser/Parser.cpp
  mlir/test/Dialect/Linalg/parallel_loops.mlir
  mlir/test/Dialect/Loops/invalid.mlir
  mlir/test/Dialect/Loops/ops.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74174.243015.patch
Type: text/x-patch
Size: 32156 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200206/90eebf7a/attachment.bin>


More information about the llvm-commits mailing list