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

[CIR] Add attribute visitor for lowering globals #1318

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

andykaylor
Copy link
Collaborator

This adds a new mlir-tablegen option to generate a .inc file with the complete set of attrdefs defined in a .td file and uses the file generated for CIR attrdefs to create an attr visitor. This visitor is used in the lowering of global variables directly to LLVM IR.

The purpose of this change is to align the incubator lowering implementation with the recent upstream changes to make future upstreaming easier, while also fulfilling the upstream request to have the visitor be based on a tablegen created file.

The new mlir-tablegen feature will be upstreamed after it is established here.

No observable change is intended in the CIR code.

This adds a new mlir-tablegen option to generate a .inc file with
the complete set of attrdefs defined in a .td file and uses the
file generated for CIR attrdefs to create an attr visitor. This visitor
is used in the lowering of global variables directly to LLVM IR.

The purpose of this change is to align the incubator lowering
implementation with the recent upstream changes to make future
upstreaming easier, while also fulfilling the upstream request to
have the visitor be based on a tablegen created file.

The new mlir-tablegen feature will be upstreamed after it is established
here.
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Awesome, always great to see more tablegen uses!

@bcardosolopes bcardosolopes merged commit f7b9151 into llvm:main Feb 7, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants