This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix missing verification after running an OpToOpAdaptorPass
ClosedPublic

Authored by rriddle on Mar 16 2022, 11:45 AM.

Details

Summary

The current decision of when to run the verifier is running on the
assumption that nested passes can't affect the validity of the parent
operation, which isn't true. Parent operations may attach any number
of constraints on nested operations, which may not necessarily be
captured (or shouldn't be captured) at a smaller granularity.

This commit rectifies this by properly running the verifier after an
OpToOpAdaptor pass. To avoid an explosive increase in compile time,
we only run verification on the parent operation itself. To do this, a
flag to mlir::verify is added to avoid recursive verification if it isn't
desired.

Fixes #54288

Diff Detail

Event Timeline

rriddle created this revision.Mar 16 2022, 11:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2022, 11:45 AM
rriddle requested review of this revision.Mar 16 2022, 11:45 AM
mehdi_amini accepted this revision.Mar 16 2022, 12:02 PM

I'm a bit sad about the "added complexity" of this verifyRecursively, but I guess it makes sense here!

This revision is now accepted and ready to land.Mar 16 2022, 12:02 PM
rriddle updated this revision to Diff 415991.Mar 16 2022, 2:46 PM
This revision was landed with ongoing or failed builds.Mar 16 2022, 2:54 PM
This revision was automatically updated to reflect the committed changes.