Fix SROA miscompilation issues - #7689
Conversation
PR SummaryMedium Risk Overview
SROA candidate filtering now drops locals when Adds Reviewed by Cursor Bugbot for commit 9bb4595. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
馃憤 |
## Description This PR rolls out `Block::is_entry`, as discussed in #7689 (comment). Additionally, the PR: - returns `&str` from `Block::get_label`. A new owned `String` was mostly unnecessary created, because an owned string is needed only for `IrError`s. - removes the `VerifyPassesOpts` which is not used since #7672. ## 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.
Description
This PR fixes two miscompilation issues in SROA:
combine_indicesas having a known source access at index 0 (returning empty vector for indices). This is obviously wrong since at run-time the argument can come from any of the predecessor and have an arbitrary, predecessor dependent value.combine_indicesreturningNoneand signaling that the source of indices was unknown, wasn't inspected when removing symbols from potential candidates.The provided tests cover both issues and will fail if any of them regresses.
Fixing these two issues didn't cause any changes in o2
trade-accountbenchmarks. In some o2order-bookbenchmarks there are slight regressions ~0.04% in average and 0.05% max.Additionally the PR removes reduntant
forc buildrun from theattributes_error_type_and_errortest.Checklist
Breaking*orNew Featurelabels where relevant.