[all-commits] [llvm/llvm-project] f934db: [mlir][sparse] Reject dense level after non-unique...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Tue Mar 3 03:43:11 PST 2026


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

  Changed paths:
    M mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
    M mlir/test/Dialect/SparseTensor/invalid_encoding.mlir

  Log Message:
  -----------
  [mlir][sparse] Reject dense level after non-unique level in encoding verifier (#184157)

The sparse tensor iteration model for dense levels requires exactly one
parent position to linearize into a contiguous range. However, when a
non-unique level (e.g. compressed(nonunique)) precedes a dense level,
the DedupIterator provides a two-element cursor {posLo, segHi}, causing
DenseLevel::peekRangeAt to assert and crash with:

Assertion `parentPos.size() == 1 && "Dense level can not be
non-unique."'

Fix this by adding a check in SparseTensorEncodingAttr::verify that
rejects any encoding where a dense level directly follows a non-unique
level, emitting a proper diagnostic instead of crashing during lowering.

Fixes #130008



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