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

codegen: Use idiomatic fuel-vm ops for memcpy and addr_of #6795

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Dec 19, 2024

Description

SIgnificantly reduces bytecode sizes by transforming the following commonly-used operations when the constant value fits into the immediate part of the *i variant of the instruction:

  • MOVI(tmp, copy_len); MCP(dst, src, tmp)MCPI(dst, src, copy_len) (in compile_mem_copy_bytes)
  • MOVI(dst, offset); ADD(dst, dst, DATA_SECTION)ADDI(dst, DATA_SECTION, offset) (in addr_of)

Checklist

  • I have linked to any relevant issues. (none that I know of)
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book). (no changes required)
  • I have added tests that prove my fix is effective or that my feature works. (partially; some values in tests got smaller. we don't seem to be tracking the size and size regressions in tests)
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant. (not relevant)
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@Dentosal Dentosal added compiler: codegen Everything to do with IR->ASM, register allocation, etc. compiler: optimization IR Optimization Passes labels Dec 19, 2024
@Dentosal Dentosal self-assigned this Dec 19, 2024
Copy link

codspeed-hq bot commented Dec 19, 2024

CodSpeed Performance Report

Merging #6795 will not alter performance

Comparing dento/idiomatic-opcode-optimizations (188f873) with master (192f163)

Summary

✅ 22 untouched benchmarks

@Dentosal Dentosal marked this pull request as ready for review December 19, 2024 14:48
@Dentosal Dentosal requested review from a team as code owners December 19, 2024 14:48
@Dentosal Dentosal requested a review from a team December 19, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: codegen Everything to do with IR->ASM, register allocation, etc. compiler: optimization IR Optimization Passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants