[mlir][sparse] incorporate vector index into address computation
authorAart Bik <ajcbik@google.com>
Tue, 23 Feb 2021 19:43:03 +0000 (11:43 -0800)
committerAart Bik <ajcbik@google.com>
Tue, 23 Feb 2021 21:25:51 +0000 (13:25 -0800)
commit17fa9198471eb559aa772df92484516aee1dbf87
treec2b113553c967ec9b8fdbdd770cce1a77de8e157
parent6740694742165c03e074f19141f58a8df5a887ec
[mlir][sparse] incorporate vector index into address computation

When computing dense address, a vectorized index must be accounted
for properly. This bug was formerly undetected because we get 0 * prev + i
in most cases, which folds away the scalar part. Now it works for all cases.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D97317
mlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
mlir/test/Dialect/Linalg/sparse_vector.mlir