[all-commits] [llvm/llvm-project] 0e5cad: [mlir][vector] Fold vector extract from insert whe...

Erick Ochoa Lopez via All-commits all-commits at lists.llvm.org
Thu Apr 16 06:34:59 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e5cad062cd55499ae12fd3ef4bdb555dc2169f4
      https://github.com/llvm/llvm-project/commit/0e5cad062cd55499ae12fd3ef4bdb555dc2169f4
  Author: Erick Ochoa Lopez <erick.ochoalopez at amd.com>
  Date:   2026-04-16 (Thu, 16 Apr 2026)

  Changed paths:
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    A mlir/test/Dialect/Vector/canonicalize/vector-extract.mlir

  Log Message:
  -----------
  [mlir][vector] Fold vector extract from insert when trailing unit dims (#192109)

Upstreamed from https://github.com/iree-org/iree/pull/23789

Folds vector.extract from vector.insert when the extract position is a
prefix of the insert position and the remaining (un-indexed) dimensions
of the extracted sub-vector are all size 1. In that case the extracted
value is fully determined by the inserted value.

Example:
  %ins = vector.insert %s, %v [3, 0] : f32 into vector<16x1xf32>
  %ext = vector.extract %ins [3] : vector<1xf32> from vector<16x1xf32>
folds to:
  %ext = vector.broadcast %s : f32 to vector<1xf32>

Co-authored-by: Jakub Kuderski <kubakuderski at gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply at anthropic.com>



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