-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Optimize initialization of mostly zeroed aggregates #7542
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
base: master
Are you sure you want to change the base?
Conversation
PR SummaryMedium Risk Overview Extends lowering plumbing with Written by Cursor Bugbot for commit 101734d. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| for (insert_idx, initializer) in initializers.iter().enumerate() { | ||
| if initializer.is_runtime_zeroed(context) && skip_zeroes { | ||
| // This element is zero-initialized. We can skip initializing it again. | ||
| continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping zero initializers leaves nested init_aggr instructions unlowered
High Severity
When skip_zeroes is true and an initializer passes the is_runtime_zeroed check, the code uses continue to skip the call to lower_single_initializer_to_stores. However, if the initializer is a NestedInitAggr, this skips the critical cleanup code that removes the nested init_aggr instruction from the IR. Since nested init_aggrs are excluded from find_root_init_aggrs, they aren't removed at the end of the pass either. This leaves unlowered InitAggr instructions in the IR, causing the "InstOp::InitAggr was not lowered" compiler errors shown in the test failures for cases like [0], (0,), and S1 { a: 0 }.
Additional Locations (1)
|
👍 |


Uh oh!
There was an error while loading. Please reload this page.