Skip to content

[MIR] Serialize MachineFrameInfo::isCalleeSavedInfoValid() #90561

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

Merged

Conversation

dtellenbach
Copy link
Member

In case of functions without a stack frame no "stack" field is serialized into MIR which leads to isCalleeSavedInfoValid being false when reading a MIR file back in. To fix this we should serialize MachineFrameInfo::isCalleeSavedInfoValid() into MIR.

@dtellenbach dtellenbach requested review from arsenm and francisvm April 30, 2024 05:30
Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

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

Needs a parsing test where this is true. Can you also add one that hit the issue you described? Can we just print the empty list in this case?

@dtellenbach
Copy link
Member Author

Can we just print the empty list in this case?

That wouldn't help because the logic in MIRParser would still not find any callee-saved info and set it as not valid.

@francisvm
Copy link
Collaborator

Can we just print the empty list in this case?

That wouldn't help because the logic in MIRParser would still not find any callee-saved info and set it as not valid.

Would an empty stack list, isCalleeSavedInfoValid: true and -run-pass none test the right thing?

@dtellenbach
Copy link
Member Author

Can we just print the empty list in this case?

That wouldn't help because the logic in MIRParser would still not find any callee-saved info and set it as not valid.

Would an empty stack list, isCalleeSavedInfoValid: true and -run-pass none test the right thing?

Oh yes, testing is no issue. I understood the question as can't we omit isCalleeSavedInfoValid when just using an empty stack list.

@dtellenbach dtellenbach force-pushed the serialize-isCalleeSavedInfoValid branch from b9033e3 to 9eec28c Compare April 30, 2024 23:25
@dtellenbach
Copy link
Member Author

Added a test that should cover all combinations of having a stack or not and having valid callee-saved info or not.

@dtellenbach dtellenbach force-pushed the serialize-isCalleeSavedInfoValid branch from 9eec28c to a58a346 Compare May 1, 2024 01:28
@dtellenbach
Copy link
Member Author

Sure, the newly added test is failing because llc uses the x86 runner's target triple which doesn't know $lr. Moving to MIR/AArch64 and requiring an arm64 triple.

@dtellenbach dtellenbach force-pushed the serialize-isCalleeSavedInfoValid branch 2 times, most recently from e0e9cb8 to 48fe7a8 Compare May 1, 2024 02:48
Copy link
Collaborator

@francisvm francisvm left a comment

Choose a reason for hiding this comment

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

LGTM

In case of functions without a stack frame no "stack" field is
serialized into MIR which leads to isCalleeSavedInfoValid being false
when reading a MIR file back in. To fix this we should serialize
MachineFrameInfo::isCalleeSavedInfoValid() into MIR.
@dtellenbach dtellenbach force-pushed the serialize-isCalleeSavedInfoValid branch from 48fe7a8 to 3586507 Compare May 1, 2024 03:42
@dtellenbach dtellenbach merged commit cf2f32c into llvm:main May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants