From 8c5cad8d5e693a239e6c3465403107887a262eeb Mon Sep 17 00:00:00 2001 From: unlsycn Date: Wed, 27 Nov 2024 18:49:10 +0000 Subject: [PATCH] [FIRRTL] fix missing type conversion in FoldRegMems Signed-off-by: unlsycn --- lib/Dialect/FIRRTL/FIRRTLFolds.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Dialect/FIRRTL/FIRRTLFolds.cpp b/lib/Dialect/FIRRTL/FIRRTLFolds.cpp index 564801917769..be6b805dfea5 100644 --- a/lib/Dialect/FIRRTL/FIRRTLFolds.cpp +++ b/lib/Dialect/FIRRTL/FIRRTLFolds.cpp @@ -3035,7 +3035,8 @@ struct FoldRegMems : public mlir::RewritePattern { next = rewriter.create(next.getLoc(), en, masked, next); } - rewriter.create(reg.getLoc(), reg, next); + Value typedNext = rewriter.create(next.getLoc(), ty, next); + rewriter.create(reg.getLoc(), reg, typedNext); // Delete the fields and their associated connects. for (Operation *conn : connects)