Page MenuHomePhabricator

[mlir][DialectConversion] Emit an error if an operation marked as erased has live users after conversion
AcceptedPublic

Authored by rriddle on Mon, Jun 29, 5:55 PM.

Details

Reviewers
ftynse
Summary

Up until now, there has been an implicit agreement that when an operation is marked as
"erased" all uses of that operation's results are guaranteed to be removed during conversion. How this works in practice is that there is either an assert/crash/asan failure/etc. This revision adds support for properly detecting when an erased operation has dangling users, emits and error and fails the conversion.

Diff Detail

Event Timeline

rriddle created this revision.Mon, Jun 29, 5:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Jun 29, 5:55 PM
ftynse accepted this revision.Tue, Jun 30, 10:47 AM
ftynse added inline comments.
mlir/lib/Transforms/DialectConversion.cpp
706

Nit: indices in replacement ?

1874

Nit: "legalize any remaining legalization artifacts" sounds tautological

1971

Nit: swap the condition + continue

This revision is now accepted and ready to land.Tue, Jun 30, 10:47 AM