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

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


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77363fbd7ca24206a991eeb43d5ded54dd52a1f6
      https://github.com/llvm/llvm-project/commit/77363fbd7ca24206a991eeb43d5ded54dd52a1f6
  Author: Andrzej Warzyński <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 (#151503)

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