[PATCH] D78447: [mlir][SCCP] Add support for propagating constants in the presence of region based control flow.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 18 23:09:43 PDT 2020


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

This is possible by adding two new ControlFlowInterface additions:

- A new interface, RegionBranchOpInterface

This interface allows for region holding operations to describe how control flows between regions. This interface initially contains two methods:

- getRegionEntryOperands

Returns the set of operands that correspond to entry values to a given region. The operands may correspond to a subset of the entry arguments to the region.

- getSuccessorRegions

Returns the viable successors of a region, or the possible successor when branching from the parent op. This allows for describing which regions may be executed when entering an operation, and which regions are executed by "branching" from other regions. For example, a structured loop operation may always enter into the loop body region. The loop body region may branch back to itself, or exit to the operation.

- A trait, ReturnLike

This trait signals that a terminator exits a region and forwards all of its operands as "exiting" values.

These additions allow for performing more general dataflow analysis in the presence of region holding operations.

Depends On D78397 <https://reviews.llvm.org/D78397>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78447

Files:
  mlir/include/mlir/Dialect/LoopOps/LoopOps.h
  mlir/include/mlir/Dialect/LoopOps/LoopOps.td
  mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
  mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
  mlir/lib/Dialect/LoopOps/LoopOps.cpp
  mlir/lib/Transforms/SCCP.cpp
  mlir/test/Transforms/sccp-structured.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78447.258582.patch
Type: text/x-patch
Size: 26338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200419/c345bfc1/attachment.bin>


More information about the llvm-commits mailing list