[all-commits] [llvm/llvm-project] 152d29: [mlir][Transforms] Add pass to perform sparse cond...

River Riddle via All-commits all-commits at lists.llvm.org
Tue Apr 21 03:03:36 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 152d29cc74b8dd47e93255d1e8bb1361f5828d1b
      https://github.com/llvm/llvm-project/commit/152d29cc74b8dd47e93255d1e8bb1361f5828d1b
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-21 (Tue, 21 Apr 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
    M mlir/include/mlir/Transforms/FoldUtils.h
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/Transforms/CMakeLists.txt
    A mlir/lib/Transforms/SCCP.cpp
    M mlir/lib/Transforms/Utils/FoldUtils.cpp
    A mlir/test/Transforms/sccp.mlir

  Log Message:
  -----------
  [mlir][Transforms] Add pass to perform sparse conditional constant propagation

This revision adds the initial pass for performing SCCP generically in MLIR. SCCP is an algorithm for propagating constants across control flow, and optimistically assumes all values to be constant unless proven otherwise. It currently supports branching control, with support for regions and inter-procedural propagation being added in followups.

Differential Revision: https://reviews.llvm.org/D78397


  Commit: 2eda87dfbe63bae43b81b22c8c76a3139147797b
      https://github.com/llvm/llvm-project/commit/2eda87dfbe63bae43b81b22c8c76a3139147797b
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-21 (Tue, 21 Apr 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/LoopOps/LoopOps.h
    M mlir/include/mlir/Dialect/LoopOps/LoopOps.td
    M mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.h
    M mlir/include/mlir/Interfaces/ControlFlowInterfaces.td
    M mlir/lib/Dialect/LoopOps/LoopOps.cpp
    M mlir/lib/Transforms/SCCP.cpp
    A mlir/test/Transforms/sccp-structured.mlir

  Log Message:
  -----------
  [mlir][SCCP] Add support for propagating constants across inter-region control flow.

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:

* getSuccessorEntryOperands
Returns the operands of this operation used as the entry arguments when entering the region at `index`, which was specified as a successor by `getSuccessorRegions`. when entering. These operands should correspond 1-1 with the successor inputs specified in `getSuccessorRegions`, and may be a subset of the entry arguments for that 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 after having executed another region of the parent op. 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.

Differential Revision: https://reviews.llvm.org/D78447


Compare: https://github.com/llvm/llvm-project/compare/4ccafab0769f...2eda87dfbe63


More information about the All-commits mailing list