[PATCH] D75837: Introduce std.execute_region op

Uday Bondhugula via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 8 22:55:18 PDT 2020


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

- This isn't meant for a full review for committing but to serve as a reference and to provide a better picture on the implications (also, as far as terminators go).

The proposal on this was discussed here with everyone in favor:
https://llvm.discourse.group/t/introduce-std-inlined-call-op-proposal/282

- Instead of the std dialect, this could live in the 'region' / 'cf' dialect which the 'loop' dialect is expected to be renamed to. This op can then be named region.execute or region.once given region.for, region.if.

- an abstraction like this enables one to inline a function without lowering out all other higher level control flow constructs (affine.for/if, loop.for/if) to the flat list of blocks / std CFG form. It thus allows the benefit of transforms on higher level control flow ops available in the presence of the inlined calls. The inlined calls continue to benefit from propagation of SSA values across their top boundary. Functions won’t have to remain outlined until later than desired.

- Abstractions like affine grayboxes, lambdas with implicit captures (or even explicit when possible) could be lowered to this without first lowering out structured loops/ifs or outlining. But two early use cases are of: (1) an early inliner (which can inline functions by introducing execute_region ops), (2) lowering of an affine.graybox, which nicely maps to an execute_region when going from the affine dialect to the loop dialect.

Signed-off-by: Uday Bondhugula <uday at polymagelabs.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75837

Files:
  mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
  mlir/lib/Dialect/StandardOps/IR/Ops.cpp
  mlir/test/IR/core-ops.mlir
  mlir/test/Transforms/canonicalize.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75837.249030.patch
Type: text/x-patch
Size: 6188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200309/afb18acf/attachment.bin>


More information about the llvm-commits mailing list