[all-commits] [llvm/llvm-project] 653880: [mlir][tensor] Add patterns that fold ops into pac...

Han-Chung Wang via All-commits all-commits at lists.llvm.org
Wed Jan 11 13:52:09 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 65388086e68245c11c5acf5cd6b3570d8e4d11bf
      https://github.com/llvm/llvm-project/commit/65388086e68245c11c5acf5cd6b3570d8e4d11bf
  Author: Hanhan Wang <hanchung at google.com>
  Date:   2023-01-11 (Wed, 11 Jan 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/Tensor/Transforms/Transforms.h
    M mlir/lib/Dialect/Tensor/Transforms/CMakeLists.txt
    A mlir/lib/Dialect/Tensor/Transforms/FoldIntoPackAndUnpackPatterns.cpp
    A mlir/test/Dialect/Tensor/fold-into-pack-and-unpack.mlir
    M mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp

  Log Message:
  -----------
  [mlir][tensor] Add patterns that fold ops into pack and unpack ops.

The tensor.pack ops have pad semantic, so we can fold pad + pack into
pack when

1. They have the same padding values or the pack op does not have
   padding values.
2. The pad op does not have low paddings.

The tensor.unpack ops have extract_slice semantic, so we can fold unpack
+ extract_slice into unpack when

1. All the offsets are 0s.
2. All the strides are 1s.

Reviewed By: tyb0807

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




More information about the All-commits mailing list