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

[RTGTest] Add some registers #7924

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

maerhart
Copy link
Member

This adds some registers to later test passes such as register alloction, assembly emission, correct behavior of the elaboration pass in presence of registers, etc.

@maerhart maerhart added the RTG Involving the `rtg` dialect label Nov 29, 2024
Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +47 to +58
Virtual registers will be assigned a concrete register when running register
allocation.
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably doesn't make sense for a test dialect, but in practice, would you have virtual registers as a separate op that cannot be CSEd, and actual ISA register as something "pure" or maybe even "constant-like"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Having concrete registers CSE would be very nice. Having separate ops for concrete and virtual registers complicates register allocation a bit but makes elaboration easier. Let me think about that a bit more.


// Flat allocation of unique IDs to all registers. The actual ID value does not
// matter.
def RegisterAttr : I32EnumAttr<
Copy link
Member Author

Choose a reason for hiding this comment

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

I think ideally this attribute should be of IntegerRegisterType, not I32. It's not a big deal for now though.

@maerhart maerhart force-pushed the maerhart-rtg-getsizeops-elaboration branch from 31e652b to 81f191f Compare December 9, 2024 15:18
Base automatically changed from maerhart-rtg-getsizeops-elaboration to main December 9, 2024 15:33
This adds some registers to later test passes such as register alloction, assembly emission, correct behavior of the elaboration pass in presence of registers, etc.

Co-authored-by: Andrew Lenharth <[email protected]>
@maerhart maerhart force-pushed the maerhart-rtgtest-registers branch from 49fccfd to d868ec9 Compare December 9, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTG Involving the `rtg` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants