Skip to content

Commit

Permalink
pr: Fix assign result conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
xlauko committed Jan 29, 2025
1 parent 27d3596 commit 202c344
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/vast/Conversion/Parser/ToParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,12 @@ namespace vast::conv {
) const override {
auto args = realized_operand_values(adaptor.getOperands(), rewriter);
rewriter.create< pr::Assign >(op.getLoc(), std::vector< mlir_type >(), args);
rewriter.replaceAllUsesWith(op, args[0]);
rewriter.eraseOp(op);

if (!op->getUsers().empty()) {
rewriter.replaceOp(op, args[0]);
} else {
rewriter.eraseOp(op);
}
return mlir::success();
}
};
Expand Down

0 comments on commit 202c344

Please sign in to comment.