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

Merge copy instructions if possible #969

Merged
merged 8 commits into from
Apr 24, 2024
Merged

Merge copy instructions if possible #969

merged 8 commits into from
Apr 24, 2024

Conversation

Robbepop
Copy link
Member

@Robbepop Robbepop commented Mar 25, 2024

Closes #946.

This merges two copy instructions to a copy2 instruction if possible.

Locally I saw ~20% perf improvement for the fibonacci/iter benchmark test case which actually profits from this optimization since it features 2 consecutive (local.set n (local.get m)) in its .wat code:

image

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.81%. Comparing base (a3f91aa) to head (0b91bd1).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #969      +/-   ##
==========================================
+ Coverage   81.77%   81.81%   +0.03%     
==========================================
  Files         262      263       +1     
  Lines       24378    24426      +48     
==========================================
+ Hits        19936    19984      +48     
  Misses       4442     4442              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Robbepop
Copy link
Member Author

The miri CI job fails because of this issue: rust-lang/miri#3404

@Robbepop
Copy link
Member Author

I just checked locally if ffmpeg.wasm can still be run successfully with this optimization enabled. Together with the accompanied unit tests and the entire Wasm spec testsuite passing I am confident enough in this optimization to merge it.

@Robbepop Robbepop merged commit 5d7ddfd into master Apr 24, 2024
17 checks passed
@Robbepop Robbepop deleted the rf-merge-copy-instrs branch April 24, 2024 17:54
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.

Optimization: Fuse transitive copies
1 participant