[all-commits] [llvm/llvm-project] 18c8c9: [MLIR] Introduce scf.execute_region op
Uday Bondhugula via All-commits
all-commits at lists.llvm.org
Fri Jun 18 03:10:17 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 18c8c934d8584f706dfca9e633f0f89cefe3688e
https://github.com/llvm/llvm-project/commit/18c8c934d8584f706dfca9e633f0f89cefe3688e
Author: Uday Bondhugula <uday at polymagelabs.com>
Date: 2021-06-18 (Fri, 18 Jun 2021)
Changed paths:
M mlir/include/mlir/Dialect/SCF/SCFOps.td
M mlir/lib/Dialect/SCF/SCF.cpp
M mlir/test/Dialect/SCF/canonicalize.mlir
M mlir/test/Dialect/SCF/invalid.mlir
M mlir/test/Dialect/SCF/ops.mlir
M mlir/utils/vim/syntax/mlir.vim
Log Message:
-----------
[MLIR] Introduce scf.execute_region op
Introduce the execute_region op that is able to hold a region which it
executes exactly once. The op encapsulates a CFG within itself while
isolating it from the surrounding control flow. Proposal discussed here:
https://llvm.discourse.group/t/introduce-std-inlined-call-op-proposal/282
execute_region enables one to inline a function without lowering out all
other higher level control flow constructs (affine.for/if, scf.for/if)
to the flat list of blocks / 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 execute_regions, lambdas with implicit captures could be lowered
to this without first lowering out structured loops/ifs or outlining.
But two potential early use cases are of: (1) an early inliner (which
can inline functions by introducing execute_region ops), (2) lowering of
an affine.execute_region, which cleanly maps to an scf.execute_region
when going from the affine dialect to the scf dialect.
Differential Revision: https://reviews.llvm.org/D75837
More information about the All-commits
mailing list