[mlir][sparse] fix bug in complex zero detection
authorAart Bik <ajcbik@google.com>
Thu, 4 Aug 2022 18:49:00 +0000 (11:49 -0700)
committerAart Bik <ajcbik@google.com>
Thu, 4 Aug 2022 20:35:13 +0000 (13:35 -0700)
commit7f5b16733651c658b8cb4b05f2a3075ce84c3057
treeee002eaf97a263f381fcb91b9df19ac7f6413048
parent6e45162adfec14ef4f53ec99312cb26d23f929bc
[mlir][sparse] fix bug in complex zero detection

We were checking real-part twice, not real/imag-part.
The new test only passes after the bug fix.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D131190
mlir/lib/Dialect/SparseTensor/Utils/Merger.cpp
mlir/test/Dialect/SparseTensor/sparse_fp_ops.mlir