Avatar for the FuelLabs user
FuelLabs
sway
BlogDocsChangelog

Performance History

Latest Results

Fix redundant ops (#7636) ## Description We have been considering any `NOOP`, and others, as redundant, but in reality they are only redundant if their const def registers are not read by the immediate op. This PR takes this into consideration. ## Checklist - [ ] I have linked to any relevant issues. - [x] 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). - [ ] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
master
9 hours ago
fix PR nitpicks
xunilrj/fix-redundant-ops
23 hours ago
Apply rustfmt formatting to compile_indexing
Dnreikronos:fix/index-read-ref-mut-array-7602
2 days ago
Optimize away zero-length MCP/MCPI instructions (#7629) ## Description `MCP` with length=0 does nothing at runtime in FuelVM: no panic, no memory change. It resets `$err` to 0, but every instruction does that anyway. So we can safely strip these out. This adds two match arms to `remove_redundant_ops()`: - `MCP(_, _, len)` where `len` is `$zero` (set by constant propagation) - `MCPI(_, _, imm)` where the immediate is 0 Since this runs after `constant_propagate()` and `dce()`, any register known to be zero is already `$zero` by the time we get here. Leftover setup instructions (like `MOVI len_reg, 0`) become dead code, and DCE cleans them up on the next round. The IR-level path (`compile_mem_copy_bytes`) already skips zero-length copies at compile time. This catches the cases that only resolve to zero after constant propagation at the ASM level (inline ASM paths, `Vec` push of empty slices, etc.). Closes #7624 ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (Forc, Sway book, etc.). - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a) parsing test in `core/trybuild`, if needed. - [x] I have added the necessary `Breaking*` or `New Feature` labels, if relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/0014-code-standards.md). - [x] I have requested a review from the relevant team or maintainers. ## Test plan - `mcp_zero_len.sw` IR generation test: checks that `mcp` shows up in the IR but is gone from final ASM (`not: mcp` filecheck directive) - All 78 IR generation tests still pass - Manually confirmed with `forc build --asm final` on a script using `asm { mcp dst src zero; }`, no `mcp` in output --------- Co-authored-by: Igor Rončević <ironcev@hotmail.com>
master
2 days ago
Merge branch 'master' into Dnreikronos/optimize-mcp-zero-length
Dnreikronos:Dnreikronos/optimize-mcp-zero-length
2 days ago
Run cargo fmt and update snapshot tests
Dnreikronos:Dnreikronos/optimize-mcp-zero-length
6 days ago
fix test expected value
xunilrj/fix-redundant-ops
7 days ago

Latest Branches

CodSpeed Performance Gauge
+10%
Fix redundant ops#7636
1 day ago
7575fe5
xunilrj/fix-redundant-ops
CodSpeed Performance Gauge
0%
ir-gen: Fix ICE when reading an indexed ref mut array element#7644
2 days ago
b7bcec1
Dnreikronos:fix/index-read-ref-mut-array-7602
CodSpeed Performance Gauge
0%
2 days ago
8d92e1a
Dnreikronos:Dnreikronos/optimize-mcp-zero-length
© 2026 CodSpeed Technology
Home Terms Privacy Docs