[all-commits] [llvm/llvm-project] af73ae: [MLIR][Vector] Add unroll pattern for vector.shape...

Nishant Patel via All-commits all-commits at lists.llvm.org
Wed Nov 19 16:17:05 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: af73aeaa19929127655d544b48a5145105e9e28c
      https://github.com/llvm/llvm-project/commit/af73aeaa19929127655d544b48a5145105e9e28c
  Author: Nishant Patel <nishant.b.patel at intel.com>
  Date:   2025-11-19 (Wed, 19 Nov 2025)

  Changed paths:
    M mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
    M mlir/test/Dialect/Vector/vector-unroll-options.mlir
    M mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp

  Log Message:
  -----------
  [MLIR][Vector] Add unroll pattern for vector.shape_cast (#167738)

This PR adds pattern for unrolling shape_cast given a targetShape. This
PR is a follow up of #164010 which was very general and was using
inserts and extracts on each element (which is also
LowerVectorShapeCast.cpp is doing).
After doing some more research on use cases, we (me and @Jianhui-Li )
realized that the previous version in #164010 is unnecessarily generic
and doesn't fit our performance needs.

Our use case requires that targetShape is contiguous in both source and
result vector.

This pattern only applies when contiguous slices can be extracted from
the source vector and inserted into the result vector such that each
slice remains in vector form with targetShape (and not decompose to
scalars). In these cases, the unrolling proceeds as:

vector.extract_strided_slice -> vector.shape_cast (on the slice
unrolled) -> vector.insert_strided_slice



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list