| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Improve `inline` heuristic to avoid the final inlined function to be too big (#7710) ## Description This PR avoids the `inline` optimization to creating huge functions, and so avoiding issues like register spill, downgrading near to far calls etc... To help to diagnose this problem I have also created the "inspect" tool. It was vibe-coded, and it is a wonderful playground for anything IR related. To allow "inspect" to print the original source near IR I created another type of metatada definition which inline auto-generated code. That allows us to see what is the generated IR for the `__entry` function. I have also improved some of the scripts to generate benchmarks: now they work even when test names do not match (a problem when one create tests), and support for md tables, as the old code would fail silently. ## Checklist - [ ] I have linked to any relevant issues. - [ ] 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) - [ ] 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). - [ ] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Igor Rončević <ironcev@hotmail.com> | 1 个月前 | |
chore: bumpt rust version to 1.90 (#7427) ## Description Bumping the rust version to 1.90 and fixing the clippy lints along the way | 11 个月前 | |
Fix `copy_prop_reverse` cycle detection (#7702) ## Description This PR solves a bug when a valid `sway` code generates a cycle of `memcpys`. One simple example is the `e2e` test at `test/src/e2e_vm_tests/test_programs/should_pass/language/references/arg_ref_mut_return_by_value`. The IR generated is something like: ``` v35v1 = get_local __ptr { u64 }, s, !30 ... v76v1 = load v35v1, !33 br block0(v76v1), !33 block0(mut v71v1: { u64 }): v38v1 = get_local __ptr { u64 }, s, !41 store v71v1 to v38v1, !41 ``` We end-up copying `s` into itself. The issue that this caused was that `copy_prop_reverse` inside the `memcpyopt` was hanging forever. Now, `copy_prop_reverse` cycle detection is more robust and detect any cycle, but we just bail all the optimizations as before. To mark future improvements, I have add some optimizations I found at https://github.com/FuelLabs/sway/issues/7282#issuecomment-5196527165, and have put some TODOS around the code pointing to this issue. ## Checklist - [x] 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) - [ ] 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. - [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/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Igor Rončević <ironcev@hotmail.com> | 1 个月前 | |
Improve `inline` heuristic to avoid the final inlined function to be too big (#7710) ## Description This PR avoids the `inline` optimization to creating huge functions, and so avoiding issues like register spill, downgrading near to far calls etc... To help to diagnose this problem I have also created the "inspect" tool. It was vibe-coded, and it is a wonderful playground for anything IR related. To allow "inspect" to print the original source near IR I created another type of metatada definition which inline auto-generated code. That allows us to see what is the generated IR for the `__entry` function. I have also improved some of the scripts to generate benchmarks: now they work even when test names do not match (a problem when one create tests), and support for md tables, as the old code would fail silently. ## Checklist - [ ] I have linked to any relevant issues. - [ ] 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) - [ ] 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). - [ ] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: Igor Rončević <ironcev@hotmail.com> | 1 个月前 | |
chore: bump to v0.58.0 (#6003) ## Description Bumps sway repo to 0.58.0. | 2 年前 |
Sway Intermediate Representation
This crate is a work-in-progress library for providing an SSA style IR for the Sway middle end.
It is modelled after LLVM to a degree, and is designed to simplify the optimization phase of the compiler pipeline.
It is currently lacking several features and documentation, not to mention optimization passes, but is already capable of being targeted by Sway for codegen and passes the test suite.