[all-commits] [llvm/llvm-project] 00c6b4: [MLIR][Vector] Fix crash in foldDenseElementsAttrD...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Sat Mar 28 03:08:46 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00c6b4dabd66d51ac672db710d16674ab4fa0c89
      https://github.com/llvm/llvm-project/commit/00c6b4dabd66d51ac672db710d16674ab4fa0c89
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-03-28 (Sat, 28 Mar 2026)

  Changed paths:
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/test/Dialect/Vector/canonicalize.mlir

  Log Message:
  -----------
  [MLIR][Vector] Fix crash in foldDenseElementsAttrDestInsertOp on poison index (#188508)

When a dynamic index of -1 (the kPoisonIndex sentinel) was folded into
the static position of a vector.insert op,
foldDenseElementsAttrDestInsertOp would proceed to call
calculateInsertPosition, which returned -1. The subsequent iterator
arithmetic (allValues.begin() + (-1)) was undefined behaviour, causing
an assertion in DenseElementsAttr::get.

Fix by bailing out early in foldDenseElementsAttrDestInsertOp when any
static position equals kPoisonIndex, consistent with how
InsertChainFullyInitialized already guards this case.

Fixes #188404

Assisted-by: Claude Code



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