diff options
| author | Jordan Rupprecht <rupprecht@google.com> | 2025-10-29 15:40:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-29 15:40:05 -0500 |
| commit | 34c58c8b7c3dbf831bb1d26f1624af3e6a56edc7 (patch) | |
| tree | 2ab639d8a8ee00246fccfc9d6f691cb83265c563 /llvm/unittests/Object/ELFObjectFileTest.cpp | |
| parent | c1423f36da14c8a0fa84a5b5535d3db838e8e824 (diff) | |
| download | llvm-34c58c8b7c3dbf831bb1d26f1624af3e6a56edc7.zip llvm-34c58c8b7c3dbf831bb1d26f1624af3e6a56edc7.tar.gz llvm-34c58c8b7c3dbf831bb1d26f1624af3e6a56edc7.tar.bz2 | |
[mlir][sparse] Include sparse emit strategy in wrapping iterator (#165611)
When we create a `SparseIterator`, we sometimes wrap it in a
`FilterIterator`, which delegates _some_ calls to the underlying
`SparseIterator`.
After construction, e.g. in `makeNonEmptySubSectIterator()`, we call
`setSparseEmitStrategy()`. This sets the strategy only in one of the
filters -- if we call `setSparseEmitStrategy()` immediately after
creating the `SparseIterator`, then the wrapped `SparseIterator` will
have the right strategy, and the `FilterIterator` strategy will be
unintialized; if we call `setSparseEmitStrategy()` after wrapping the
iterator in `FilterIterator`, then the opposite happens.
If we make `setSparseEmitStrategy()` a virtual method so that it's
included in the `FilterIterator` pattern, and then do all reads of
`emitStrategy` via a virtual method as well, it's pretty simple to
ensure that the value of `strategy` is being set consistently and
correctly.
Without this, the UB of strategy being uninitialized manifests as a
sporadic test failure in
mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_strided_conv_2d_nhwc_hwcf.mlir,
when run downstream with the right flags (e.g. asan + assertions off).
The test sometimes fails with `ne_sub<trivial<dense[0,1]>>.begin' op
created with unregistered dialect`. It can also be directly observed w/
msan that this uninitialized read is the cause of that issue, but msan
causes other problems w/ this test.
Diffstat (limited to 'llvm/unittests/Object/ELFObjectFileTest.cpp')
0 files changed, 0 insertions, 0 deletions
