Page MenuHomePhabricator

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

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

Details

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.Jun 29 2020, 5:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2020, 5:55 PM
ftynse accepted this revision.Jun 30 2020, 10:47 AM
ftynse added inline comments.
mlir/lib/Transforms/DialectConversion.cpp
706

Nit: indices in replacement ?

1877

Nit: "legalize any remaining legalization artifacts" sounds tautological

1974

Nit: swap the condition + continue

This revision is now accepted and ready to land.Jun 30 2020, 10:47 AM
rriddle updated this revision to Diff 277931.Jul 14 2020, 11:59 AM
rriddle marked 2 inline comments as done.

Resolve comments

This revision was automatically updated to reflect the committed changes.