Skip to content

Commit 96b3bf4

Browse files
committed
[mlir][sparse] Fix a problem in the new operator rewriter.
The getSparseTensorReaderNextX functions should return void. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D138226
1 parent 534b26a commit 96b3bf4

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -930,9 +930,8 @@ struct NewRewriter : public OpRewritePattern<NewOp> {
930930
SmallString<18> getNextFuncName{"getSparseTensorReaderNext",
931931
primaryTypeFunctionSuffix(eltTp)};
932932
Value indices = dimSizes; // Reuse the indices memref to store indices.
933-
createFuncCall(rewriter, loc, getNextFuncName, {eltTp},
934-
{reader, indices, value}, EmitCInterface::On)
935-
.getResult(0);
933+
createFuncCall(rewriter, loc, getNextFuncName, {}, {reader, indices, value},
934+
EmitCInterface::On);
936935
SmallVector<Value> indicesArray;
937936
for (uint64_t i = 0; i < rank; i++) {
938937
indicesArray.push_back(rewriter.create<memref::LoadOp>(

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sum_c32.mlir

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
// RUN: mlir-opt %s --sparse-compiler | \
2-
// RUN: TENSOR0="%mlir_src_dir/test/Integration/data/test_symmetric_complex.mtx" \
3-
// RUN: mlir-cpu-runner \
4-
// RUN: -e entry -entry-point-result=void \
5-
// RUN: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \
6-
// RUN: FileCheck %s
1+
// DEFINE: %{option} = enable-runtime-library=true
2+
// DEFINE: %{command} = mlir-opt %s --sparse-compiler=%{option} | \
3+
// DEFINE: TENSOR0="%mlir_src_dir/test/Integration/data/test_symmetric_complex.mtx" \
4+
// DEFINE: mlir-cpu-runner \
5+
// DEFINE: -e entry -entry-point-result=void \
6+
// DEFINE: -shared-libs=%mlir_lib_dir/libmlir_c_runner_utils%shlibext | \
7+
// DEFINE: FileCheck %s
8+
//
9+
// RUN: %{command}
10+
//
11+
// Do the same run, but now with direct IR generation.
12+
// REDEFINE: %{option} = enable-runtime-library=false
13+
// RUN: %{command}
714

815
!Filename = !llvm.ptr<i8>
916

0 commit comments

Comments
 (0)