This is an archive of the discontinued LLVM Phabricator instance.

[mlir][irdl] Add verification of IRDL ops
ClosedPublic

Authored by math-fehr on Mar 9 2023, 3:40 PM.

Details

Summary

This patch adds verification on registered IRDL operations, types,
and attributes.

This is done through an interface implemented by operations from the
irdl dialect, which translate the operations into Constraint.
This interface is then use in the registerDialect function to
generate verifiers for the entire operation/type/attribute.

Depends on D145733

Diff Detail

Event Timeline

math-fehr created this revision.Mar 9 2023, 3:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 9 2023, 3:40 PM
math-fehr requested review of this revision.Mar 9 2023, 3:40 PM
Mogball accepted this revision.May 4 2023, 2:35 AM
Mogball added inline comments.
mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.h
36

Please add a newline here

mlir/include/mlir/Dialect/IRDL/IR/IRDLInterfaces.td
34

Please use ::llvm::

36

Please add a leading :: to all of these namespaces

mlir/lib/Dialect/IRDL/IRDLRegistration.cpp
60 ↗(On Diff #503957)

Please don't use to_string. You can stream integers right into the InFlightDiagnostic

80 ↗(On Diff #503957)

please drop trivial braces

87 ↗(On Diff #503957)

here as well

107 ↗(On Diff #503957)

LogicalResult can be implicitly converted to WalkResult.

This revision is now accepted and ready to land.May 4 2023, 2:35 AM
math-fehr updated this revision to Diff 521601.May 12 2023, 4:07 AM
math-fehr marked 7 inline comments as done.

Address comments

Rebase to head

This revision was landed with ongoing or failed builds.May 12 2023, 10:39 AM
This revision was automatically updated to reflect the committed changes.
math-fehr reopened this revision.May 12 2023, 10:51 AM

This was triggering a buildbot failure, I'm currently investigating this

This revision is now accepted and ready to land.May 12 2023, 10:51 AM
math-fehr updated this revision to Diff 522996.May 17 2023, 4:28 AM

Fix bug triggered by clang-10, and update to latest LLVM

math-fehr updated this revision to Diff 523007.May 17 2023, 5:16 AM

Update to main

This revision was automatically updated to reflect the committed changes.