From 35bb732032aca1c57ffe2dfb47d6d05e651b24e2 Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Wed, 9 Oct 2019 11:32:54 -0700 Subject: [PATCH] Guard rewriter insertion point during signature conversion. Avoid unexpected side effect in rewriter insertion point. PiperOrigin-RevId: 273785794 --- mlir/lib/Transforms/DialectConversion.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/mlir/lib/Transforms/DialectConversion.cpp b/mlir/lib/Transforms/DialectConversion.cpp index a47f17b..d65eae7 100644 --- a/mlir/lib/Transforms/DialectConversion.cpp +++ b/mlir/lib/Transforms/DialectConversion.cpp @@ -284,6 +284,7 @@ void ArgConverter::applySignatureConversion( // Remap each of the original arguments as determined by the signature // conversion. auto &newArgMapping = argMapping[block]; + OpBuilder::InsertionGuard guard(rewriter); rewriter.setInsertionPointToStart(block); for (unsigned i = 0; i != origArgCount; ++i) { ArrayRef remappedValues; -- 2.7.4