[all-commits] [llvm/llvm-project] b63549: [mlir][Affine][NFC] Return BlockArgument in Affine...

Diego Caballero via All-commits all-commits at lists.llvm.org
Fri Mar 5 14:06:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b635492c3f1a51eb2026bc2add9fefd7a92004b0
      https://github.com/llvm/llvm-project/commit/b635492c3f1a51eb2026bc2add9fefd7a92004b0
  Author: Diego Caballero <diego.caballero at intel.com>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/Affine/IR/AffineOps.td

  Log Message:
  -----------
  [mlir][Affine][NFC] Return BlockArgument in AffineForOp::getInductionVar

This avoids unnecessary casts when a BlockArgument is required.

Reviewed By: bondhugula

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


  Commit: 71a86245ca620d26ed63a86dda3b65a533f5df6b
      https://github.com/llvm/llvm-project/commit/71a86245ca620d26ed63a86dda3b65a533f5df6b
  Author: Diego Caballero <diego.caballero at intel.com>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M mlir/include/mlir/IR/Block.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/Region.h
    M mlir/include/mlir/IR/Visitors.h
    M mlir/lib/Analysis/Liveness.cpp
    M mlir/lib/Analysis/NumberOfExecutions.cpp
    M mlir/lib/IR/Visitors.cpp

  Log Message:
  -----------
  [mlir] Extend Operation visitor with pre-order traversal

This patch extends the Region, Block and Operation visitors to also support pre-order walks.
We introduce a new template argument that dictates the walk order (only pre-order and
post-order are supported for now). The default order for Regions, Blocks and Operations is
post-order. Mixed orders (e.g., Region/Block pre-order + Operation post-order) could easily
be implemented, as shown in NumberOfExecutions.cpp.

Reviewed By: rriddle, frgossen, bondhugula

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


  Commit: 2de6dbda66b3ff23f1e0cb52862d90224852ae59
      https://github.com/llvm/llvm-project/commit/2de6dbda66b3ff23f1e0cb52862d90224852ae59
  Author: Diego Caballero <diego.caballero at intel.com>
  Date:   2021-03-06 (Sat, 06 Mar 2021)

  Changed paths:
    M mlir/include/mlir/IR/Block.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/Region.h
    M mlir/include/mlir/IR/Visitors.h
    M mlir/lib/IR/Visitors.cpp
    A mlir/test/IR/visitors.mlir
    M mlir/test/lib/IR/CMakeLists.txt
    A mlir/test/lib/IR/TestVisitors.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Add 'Skip' result to Operation visitor

This patch is a follow-up on D97217. It adds a new 'Skip' result to the Operation visitor
so that a callback can stop the ongoing visit of an operation/block/region and
continue visiting the next one without fully interrupting the walk. Skipping is
needed to be able to erase an operation/block in pre-order and do not continue
visiting the internals of that operation/block.

Related to the skipping mechanism, the patch also introduces the following changes:
 * Added new TestIRVisitors pass with basic testing for the IR visitors.
 * Fixed missing early increment ranges in visitor implementation.
 * Updated documentation of walk methods to include erasure information and walk
   order information.

Reviewed By: rriddle

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


Compare: https://github.com/llvm/llvm-project/compare/9059903f2d33...2de6dbda66b3


More information about the All-commits mailing list