[all-commits] [llvm/llvm-project] 0edb41: [mlir][linalg] Add control to pad-slice swap pattern

Lei Zhang via All-commits all-commits at lists.llvm.org
Wed Feb 16 08:20:00 PST 2022


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

  Changed paths:
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/include/mlir/Dialect/Tensor/IR/TensorTilingInterfaceImpl.h
    M mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
    M mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    M mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
    M utils/bazel/llvm-project-overlay/mlir/BUILD.bazel

  Log Message:
  -----------
  [mlir][linalg] Add control to pad-slice swap pattern

The pad-slice swap pattern generates `scf.if` and `tensor.generate`
to guard against zero-sized slices if it cannot prove the slice is
always non-zero. This is safe but quite conservative. It can be
unnecessary for cases where we know by problem definition such cases
does not exist, even if with dynamic shaped ops or unknown tile/slice
sizes, e.g., convolution padding size = 1 with kernel dim size = 3.

So this commit introduces a control to the pattern to specify
whether to generate the if constructs to handle such cases better,
given that once the if constructs is materialized, it's very hard
to analyze and simplify.

Reviewed By: mravishankar

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




More information about the All-commits mailing list