This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add InsertionGuards to OneToNPatternRewriter.
ClosedPublic

Authored by ingomueller-net on Jul 6 2023, 10:54 PM.

Details

Summary

This fixes bad behavior of that class that surfaced in
https://reviews.llvm.org/D154299, where calling applySignatureConversion
left the insertion point different from before the call, which broke a
subsequent call to replaceOp. This patch introduces a fix in both
functions, each of which is enough to fix the specific problem in the
aforementioned diff: (1) applySignatureConversion now resets the
insertion point with a guard for the whole function and (2) replace sets
the insertion point to the op that should be replaced (and resets it
with a guard).

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 10:54 PM
ingomueller-net requested review of this revision.Jul 6 2023, 10:54 PM
ftynse accepted this revision.Jul 7 2023, 12:47 AM
This revision is now accepted and ready to land.Jul 7 2023, 12:47 AM