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

chore: Remove ssa::value::Value to greatly reduce memory usage #3821

Closed
wants to merge 2 commits into from

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Dec 15, 2023

Description

Problem*

Working towards reducing memory usage in SSA for #3380

Summary*

This PR "inlines" the ssa::value::Value enum into ssa::value::ValueId to make the ValueId itself an enum and allow us to remove Value entirely. Doing this eliminates a large portion of memory usage as we no longer need to store values in separate maps at all. As an example, instruction_results: HashMap<InstructionId, Vec<Value>> alone takes up over 30% of the memory usage in #3380. In general, since ValueIds can be stored directly on Instructions, they are easier to free after each pass is finished so the total memory usage of the SSA representation grows less after each pass.

Additional Context

This PR is to better keep track of this change which currently is not close to completion.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [Exceptional Case] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher
Copy link
Contributor Author

jfecher commented Dec 10, 2024

We've had enough SSA changes since this PR was abandoned that I'm going to just restart the PR instead of trying to fix the conflicts.

@jfecher jfecher closed this Dec 10, 2024
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.

1 participant