mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
fix: create new op in generic type conversion
converting types of the original op seems to have an impact on other operations using the result type, which should consider checking the different cases (whether the type has been converted yet, or not). However, creating a new op don't have this issue
This commit is contained in:
@@ -54,11 +54,12 @@ struct GenericTypeConverterPattern : public mlir::OpRewritePattern<Op> {
|
||||
|
||||
mlir::LogicalResult
|
||||
matchAndRewrite(Op op, mlir::PatternRewriter &rewriter) const override {
|
||||
convertOperandAndResultTypes(rewriter, op,
|
||||
auto newOp = rewriter.clone(*op);
|
||||
convertOperandAndResultTypes(rewriter, newOp,
|
||||
[&](mlir::MLIRContext *, mlir::Type t) {
|
||||
return converter.convertType(t);
|
||||
});
|
||||
|
||||
rewriter.replaceOp(op, newOp->getResults());
|
||||
return mlir::success();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user