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 static handling and most of the operand codegen code to StableMIR #2931

Merged
merged 6 commits into from
Dec 12, 2023

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Dec 11, 2023

Migrate most of the operand code generation to use StableMIR APIs, and static handling.

This change is so far the one that required some re-work, since constants in StableMIR differ a bit from internal APIs. In the Rust compiler internal APIs, constant values can be using either: Scalar, Slice, Indirect (represented by an Allocation), and ZST. In the StableAPIs, a constant value is always represented with an Allocation.

To avoid making changes to the final gotoc, we generate code for allocations in two steps, we first try to generate just a regular constant literal if the constant is small (similar logic to handling the Scalar internal type).

For more complex cases, we create an allocation and read from it, similar to how Indirect / Slice internal handling used to work.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@celinval celinval requested a review from a team as a code owner December 11, 2023 01:31
@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Dec 11, 2023
@celinval celinval marked this pull request as draft December 11, 2023 02:49
@celinval celinval marked this pull request as ready for review December 11, 2023 20:39
Copy link
Contributor

@zhassan-aws zhassan-aws left a comment

Choose a reason for hiding this comment

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

Minor comments, so feel free to merge and address in a follow-up PR.

@celinval celinval enabled auto-merge (squash) December 12, 2023 05:42
@celinval celinval merged commit 9190831 into model-checking:main Dec 12, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants