This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Remove a bunch of unnecessary dialect dependencies
ClosedPublic

Authored by rriddle on Jan 24 2022, 11:58 AM.

Details

Summary

A lot of dialects have dependencies that are unnecessary, either because of copy/paste
of files when creating things or some other means. This commit cleans up a bunch of
the simple ones:

  • Copy/Paste or missed during refactoring

Most of the dependencies cleaned up here look like copy/paste errors when creating
new dialects/transformations, or because the dependency wasn't removed during a
refactoring (e.g. when splitting the standard dialect).

  • Unnecessary hard coding of constant operations in matchers

There are a few instances where a dialect had a dependency because it
was hardcoding checks for constant operations instead of using the better m_Constant
approach.

Depends on D117981

Diff Detail

Event Timeline

rriddle created this revision.Jan 24 2022, 11:58 AM
rriddle requested review of this revision.Jan 24 2022, 11:58 AM

LGTM for sparse

mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
232

just curious, does the no braces rule not apply here?

mehdi_amini accepted this revision.Jan 24 2022, 2:08 PM
This revision is now accepted and ready to land.Jan 24 2022, 2:08 PM
bondhugula accepted this revision.Jan 24 2022, 5:48 PM
This revision was landed with ongoing or failed builds.Jan 24 2022, 7:30 PM
This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.Jan 24 2022, 7:31 PM
rriddle added inline comments.
mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
232

I added braces given that both the condition and body were spilling out onto multiple lines. Kind of subjective, but ideally this would be driven by clang-tidy (which IIRC a check is underway, can't remember the status of it though).