[mlir][sparse] add sparse matmul codegen check tests

This found an insertion point bug in access pattern expansion

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D137675
This commit is contained in:
Aart Bik
2022-11-08 14:58:45 -08:00
parent 295861514e
commit 129177eaf0
2 changed files with 141 additions and 2 deletions

View File

@@ -852,6 +852,8 @@ public:
index);
genStore(rewriter, loc, constantI1(rewriter, loc, false), filled, index);
rewriter.create<scf::YieldOp>(loc, fields);
rewriter.setInsertionPointAfter(loop);
Value result = genTuple(rewriter, loc, dstType, loop->getResults());
// Deallocate the buffers on exit of the full loop nest.
Operation *parent = getTop(op);
rewriter.setInsertionPointAfter(parent);
@@ -859,8 +861,7 @@ public:
rewriter.create<memref::DeallocOp>(loc, filled);
rewriter.create<memref::DeallocOp>(loc, added);
// Replace operation with resulting memrefs.
rewriter.replaceOp(op,
genTuple(rewriter, loc, dstType, loop->getResults()));
rewriter.replaceOp(op, result);
return success();
}
};