[all-commits] [llvm/llvm-project] 21f8d4: Refactor Reduction Tree Pass

Mauricio Sifontes via All-commits all-commits at lists.llvm.org
Thu Aug 20 21:59:57 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 21f8d414689387d97120a49df3dabca10e3262e4
      https://github.com/llvm/llvm-project/commit/21f8d414689387d97120a49df3dabca10e3262e4
  Author: Mauricio Sifontes <sifontes at google.com>
  Date:   2020-08-21 (Fri, 21 Aug 2020)

  Changed paths:
    M mlir/include/mlir/Reducer/OptReductionPass.h
    R mlir/include/mlir/Reducer/Passes/FunctionReducer.h
    A mlir/include/mlir/Reducer/Passes/OpReducer.h
    M mlir/include/mlir/Reducer/ReductionNode.h
    M mlir/include/mlir/Reducer/ReductionTreePass.h
    A mlir/include/mlir/Reducer/ReductionTreeUtils.h
    M mlir/tools/mlir-reduce/CMakeLists.txt
    M mlir/tools/mlir-reduce/OptReductionPass.cpp
    R mlir/tools/mlir-reduce/Passes/FunctionReducer.cpp
    A mlir/tools/mlir-reduce/Passes/OpReducer.cpp
    M mlir/tools/mlir-reduce/ReductionNode.cpp
    R mlir/tools/mlir-reduce/ReductionTreePass.cpp
    A mlir/tools/mlir-reduce/ReductionTreeUtils.cpp
    M mlir/tools/mlir-reduce/mlir-reduce.cpp

  Log Message:
  -----------
  Refactor Reduction Tree Pass

Refactor the way the reduction tree pass works in the MLIR Reduce tool by introducing a set of utilities that facilitate the implementation of new Reducer classes to be used in the passes.

This will allow for the fast implementation of general transformations to operate on all mlir modules as well as custom transformations for different dialects.

These utilities allow for the implementation of Reducer classes by simply defining a method that indexes the operations/blocks/regions to be transformed and a method to perform the deletion or transfomration based on the indexes.

Create the transformSpace class member in the ReductionNode class to keep track of the indexes that have already been transformed or deleted at a current level.

Delete the FunctionReducer class and replace it with the OpReducer class to reflect this new API while performing the same transformation and allowing the instantiation of a reduction pass for different types of operations at the module's highest hierarchichal level.

Modify the SinglePath Traversal method to reflect the use of the new API.

Reviewed: jpienaar

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




More information about the All-commits mailing list