[all-commits] [llvm/llvm-project] 4afd0c: [mlir][sparse] Fix crash in SparseAssembler when r...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Thu Mar 5 03:27:30 PST 2026


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

  Changed paths:
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseAssembler.cpp
    A mlir/test/Dialect/SparseTensor/external_after_codegen.mlir

  Log Message:
  -----------
  [mlir][sparse] Fix crash in SparseAssembler when run after SparseTensorCodegen (#183896)

After --sparse-tensor-codegen, sparse tensor arguments are replaced by
memrefs and \!sparse_tensor.storage_specifier types. The subsequent
--sparse-assembler pass calls getSparseTensorEncoding() to identify
sparse arguments to wrap/unwrap. However, getSparseTensorEncoding()
returns non-null for StorageSpecifierType as well as for sparse
RankedTensorType. Since StorageSpecifierType is not a RankedTensorType,
the subsequent cast<RankedTensorType> in convTypes() and convVals()
would crash with an assertion failure.

Fix by also checking isa<RankedTensorType>(type) in the passthrough
condition in both convTypes() and convVals(), so that
StorageSpecifierType arguments pass through unchanged.

Fixes #183776



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