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

Andrzej Warzyński via All-commits all-commits at lists.llvm.org
Thu Jul 31 05:17:59 PDT 2025


  Branch: refs/heads/users/banach-space/update-vec-unpack
  Home:   https://github.com/llvm/llvm-project
  Commit: 33fae274c5ef92611b79e69a944676f6fba968ed
      https://github.com/llvm/llvm-project/commit/33fae274c5ef92611b79e69a944676f6fba968ed
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2025-07-31 (Thu, 31 Jul 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.



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