[all-commits] [llvm/llvm-project] e027c0: [mlir][tensor] Add a pattern to split tensor.pad ops

Lei Zhang via All-commits all-commits at lists.llvm.org
Wed Feb 16 10:44:27 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e027c00821dda48d06cf73c6c16176fcb7b8adcb
      https://github.com/llvm/llvm-project/commit/e027c00821dda48d06cf73c6c16176fcb7b8adcb
  Author: Lei Zhang <antiagainst at google.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    A mlir/include/mlir/Dialect/Tensor/Transforms/Transforms.h
    M mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Tensor/Transforms/SplitPadding.cpp
    A mlir/test/Dialect/Tensor/split-padding.mlir
    M mlir/test/lib/Dialect/CMakeLists.txt
    A mlir/test/lib/Dialect/Tensor/CMakeLists.txt
    A mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/tools/mlir-opt/mlir-opt.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
    M utils/bazel/llvm-project-overlay/mlir/test/BUILD.bazel

  Log Message:
  -----------
  [mlir][tensor] Add a pattern to split tensor.pad ops

This commit adds a pattern to wrap a tensor.pad op with
an scf.if op to separate the cases where we don't need padding
(all pad sizes are actually zeros) and where we indeed need
padding.

This pattern is meant to handle padding inside tiled loops.
Under such cases the padding sizes typically depend on the
loop induction variables. Splitting them would allow treating
perfect tiles and edge tiles separately.

Reviewed By: nicolasvasilache

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




More information about the All-commits mailing list