[all-commits] [llvm/llvm-project] 119a23: [mlir][linalg] Add getCollapsedVecType and update ...

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Fri Aug 1 03:15:59 PDT 2025


  Branch: refs/heads/users/banach-space/update-vec-unpack
  Home:   https://github.com/llvm/llvm-project
  Commit: 119a230d11b6aa5da2bea503a55d448c2500b87f
      https://github.com/llvm/llvm-project/commit/119a230d11b6aa5da2bea503a55d448c2500b87f
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2025-08-01 (Fri, 01 Aug 2025)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

  Log Message:
  -----------
  [mlir][linalg] Add getCollapsedVecType and update vectorization of linalg.unpack

This patch introduces a new helper, `getCollapsedVecType`, and updates
`vectorizeAsTensorUnpackOp` to use it. The motivation stems from improving
how `vector.shape_cast` operations are generated when vectorizing
`linalg.unpack`.

Previously, the vectorizer relied on
* `tensor::CollapseShapeOp::inferCollapsedType`

to compute the collapsed vector type. This approach is suboptimal
because:
  * `inferCollapsedType` lacks awareness of scalable vector flags.
  * Linalg vectorization should not depend on Tensor dialect utilities.

Instead of relocating `inferCollapsedType`, we introduce
`getCollapsedVecType` — a lightweight, specialized hook that:
  * Assumes no dynamic sizes.
  * Handles scalable flags alongside shape dimensions.

This change also reduces temporary variables in
`vectorizeAsTensorUnpackOp` and paves the way for a cleaner update in
 #149293.


  Commit: 4d6cb14de1a1749372c45d8a7388d2b77b46d38c
      https://github.com/llvm/llvm-project/commit/4d6cb14de1a1749372c45d8a7388d2b77b46d38c
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2025-08-01 (Fri, 01 Aug 2025)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

  Log Message:
  -----------
  Add comment


Compare: https://github.com/llvm/llvm-project/compare/7fc78d2c6aef...4d6cb14de1a1

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