Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate TypeAsmInterface to OpAsmTypeInterface #1435

Merged

Conversation

ZenithalHourlyRate
Copy link
Collaborator

@ZenithalHourlyRate ZenithalHourlyRate commented Feb 20, 2025

After the upstreaming of https://discourse.llvm.org/t/rfc-introduce-opasm-type-attr-interface-for-pretty-print-in-asmprinter/83792, we now have OpAsmTypeInterface and OpAsmAttrInterface that is directly hooked into the MLIR AsmPrinter, so there is a series of update

  • Migrate the TypeAsmInterface to OpAsmTypeInterface getAsmName method (this PR)
  • Mirgate OpAsmDialectInterface getAlias(Type) to OpAsmTypeInterface getAlias
  • Mirgate OpAsmDialectInterface getAlias(Attr) to OpAsmAttrInterface getAlias

The good thing about using OpAsmTypeInterface is that we now do not need to hack into func::FuncOp OpAsmOpInterface to make it also work for function argument; also all our op and op from MLIR (like affine.for) would respect the TypeInterface instead of manually hook into their OpInterface.

One behavior change is the grouping behavior of multi-result op. Previously it would be %0:4 now it becomes four separate SSA.

Copy link
Collaborator

@j2kun j2kun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for upstreaming this!

@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Feb 20, 2025
@copybara-service copybara-service bot merged commit 28e1101 into google:main Feb 21, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants