Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.
Prev Previous commit
Next Next commit
fix setitem lowering
  • Loading branch information
Butygin
Butygin committed Feb 20, 2021
commit 42a0964733c2cf99a761cfa1e75bde8561926898
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ struct SetitemOpLowering : public mlir::OpRewritePattern<T>
mlir::OpBuilder::InsertionGuard g(rewriter);
if (auto parent_op = target.getDefiningOp())
{
rewriter.setInsertionPoint(parent_op);
rewriter.setInsertionPointAfter(parent_op);
}
else
{
Expand All @@ -456,6 +456,7 @@ struct SetitemOpLowering : public mlir::OpRewritePattern<T>
}
else
{
mlir::OpBuilder::InsertionGuard g(rewriter);
rewriter.setInsertionPoint(use_op);
auto new_val = rewriter.create<mlir::TensorLoadOp>(use_op->getLoc(), memref);
rewriter.updateRootInPlace(use_op, [&]()
Expand Down