[mlir][SparseTensor] Fix incorrect API usage in RewritePatterns

Incorrect API usage was detected by D144552.

Differential Revision: https://reviews.llvm.org/D145166
This commit is contained in:
Matthias Springer
2023-03-02 17:22:06 +01:00
parent 37114036aa
commit ae9e1d1df4
3 changed files with 15 additions and 10 deletions

View File

@@ -444,7 +444,7 @@ public:
auto denseTp =
RankedTensorType::get(rtp.getShape(), rtp.getElementType());
auto convert = rewriter.create<ConvertOp>(loc, denseTp, op.getSrc());
op->setOperand(0, convert);
rewriter.updateRootInPlace(op, [&]() { op->setOperand(0, convert); });
return success();
}
if (encDst) {