From 9d4156a6b042d773ac0e2a4d49ff68311ef9765b Mon Sep 17 00:00:00 2001 From: Nandor Licker Date: Wed, 29 Nov 2023 07:13:13 -0800 Subject: [PATCH] [NFC][ConversionPatterns] Do not alter locations outside of the signature conversion D157882 fixed the problem --- lib/Dialect/HW/ConversionPatterns.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/Dialect/HW/ConversionPatterns.cpp b/lib/Dialect/HW/ConversionPatterns.cpp index f9ed88f0c72c..b642362a97de 100644 --- a/lib/Dialect/HW/ConversionPatterns.cpp +++ b/lib/Dialect/HW/ConversionPatterns.cpp @@ -78,12 +78,6 @@ LogicalResult circt::doTypeConversion(Operation *op, ValueRange operands, Region ®ion = op->getRegion(i); Region *newRegion = &newOp->getRegion(i); - // TypeConverter::SignatureConversion drops argument locations, so we need - // to manually copy them over (a verifier in e.g. HWModule checks this). - llvm::SmallVector argLocs; - for (auto arg : region.getArguments()) - argLocs.push_back(arg.getLoc()); - // Move the region and convert the region args. rewriter.inlineRegionBefore(region, *newRegion, newRegion->begin()); TypeConverter::SignatureConversion result(newRegion->getNumArguments()); @@ -92,10 +86,6 @@ LogicalResult circt::doTypeConversion(Operation *op, ValueRange operands, return rewriter.notifyMatchFailure(op->getLoc(), "type conversion failed"); rewriter.applySignatureConversion(newRegion, result, typeConverter); - - // Apply the argument locations. - for (auto [arg, loc] : llvm::zip(newRegion->getArguments(), argLocs)) - arg.setLoc(loc); } rewriter.finalizeRootUpdate(newOp);