This is an archive of the discontinued LLVM Phabricator instance.

WIP enforce alias printing for distinct attributes
DraftPublic

Authored by gysit on Jun 20 2023, 8:24 AM.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
rriddle
Summary

This revision is a work in progress commit that tries
to use the alias printing mechanism to number the
distinct attribute during printing. It therefore
tries to enforce that distinct attributes are always
printed as aliases.

There are two main cases to handle

  • Ignore the -mlir-print-local-scope flag
  • Print aliases even if the user dumps a non top-level operation.

Dumping a non top-level operation looks as follows:

#distinct = distinct<42 : i32>
%0 = test.my_op { distinct_attr = #distinct }

Depends on D153360

Diff Detail