This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Cleanup lingering problems surrounding attribute/type aliases
ClosedPublic

Authored by rriddle on Nov 28 2022, 6:36 PM.

Details

Summary

This commit refactors attribute/type alias generation to be similar to how
we do it for operations, i.e. we generate aliases determined on what is
actually necessary when printing the IR (using a dummy printer for alias
collection). This allows for generating aliases only when necessary, and
also allows for proper propagation of when a nested alias can be deferred.
This also necessitated a fix for location parsing to actually parse aliases
instead of ignoring them.

Fixes #59041

Diff Detail

Event Timeline

rriddle created this revision.Nov 28 2022, 6:36 PM
Herald added a reviewer: ftynse. · View Herald Transcript
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.Nov 28 2022, 6:36 PM
rriddle updated this revision to Diff 478436.Nov 28 2022, 6:36 PM
rriddle edited the summary of this revision. (Show Details)

LGTM for sparse change

Mogball accepted this revision.Nov 29 2022, 12:01 PM
Mogball added inline comments.
mlir/lib/IR/AsmPrinter.cpp
769
773
797

Can you use the new dyn_cast<DictionaryAttr>(attr) style here and everywhere else?

798
803
818
1009

Do we actually have anything in the style guide for C vs C++-style casts?

This revision is now accepted and ready to land.Nov 29 2022, 12:01 PM

Heads up, I suspect this will need a test change on the patter in https://reviews.llvm.org/D138956 so whoever goes in last may see a failure ;-)

Heads up, I suspect this will need a test change on the patter in https://reviews.llvm.org/D138956 so whoever goes in last may see a failure ;-)

Thanks for the heads up, land away (whatever breaks should be an easy fix).. I've got a log of things I'm getting through.

Thanks for the heads up, land away (whatever breaks should be an easy fix).. I've got a log of things I'm getting through.

Cool! Thanks for your flexibility!

This revision was automatically updated to reflect the committed changes.
rriddle marked 7 inline comments as done.
aartbik added inline comments.Nov 30 2022, 7:33 PM
mlir/test/Dialect/SparseTensor/sparse_vector_index.mlir
36

thanks for finding these ;-)