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

feat(perf): Remove inc_rc/dec_rc instructions that follow a removed load in mem2reg #6092

Conversation

vezenovm
Copy link
Contributor

Description

Problem*

Resolves #6088 (comment)

Summary*

If we have have an inc_rc/dec_rc instruction in mem2reg, we can check whether the previously instruction was a removed load. If it was, we can safely remove the inc_rc/dec_rc instruction.

Additional Context

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] 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.

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Changes to Brillig bytecode sizes

Generated at commit: fcaebedac4e48ca256af5fc8466ea4cfb98e9df8, compared to commit: 65a461f3f9cdd3a3fad0212ee3423e417cd29170

🧾 Summary (10% most significant diffs)

Program Brillig opcodes (+/-) %
nested_array_dynamic -3 ✅ -0.11%
reference_only_used_as_alias -6 ✅ -2.34%

Full diff report 👇
Program Brillig opcodes (+/-) %
hashmap 30,598 (-3) -0.01%
uhashmap 25,476 (-15) -0.06%
nested_array_dynamic 2,826 (-3) -0.11%
reference_only_used_as_alias 250 (-6) -2.34%

@vezenovm vezenovm marked this pull request as draft September 18, 2024 20:39
@vezenovm
Copy link
Contributor Author

Closing as this was an experiment to improve a regression in #6088 which has been turned to a draft. Either way, we should keep mem2reg as only removing loads and stores and any inc_rc/dec_rc removals should come in other passes.

@vezenovm vezenovm closed this Sep 26, 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