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

Adapt SROA MIR opt for aggregated MIR #107687

Merged
merged 7 commits into from Feb 6, 2023
Merged

Adapt SROA MIR opt for aggregated MIR #107687

merged 7 commits into from Feb 6, 2023

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Feb 5, 2023

The pass was broken by #107267.

This PR extends it to replace:

x = Struct { 0: a, 1: b }
y = move? x

by assignment between locals

x_0 = a
x_1 = b
y_0 = move? x_0
y_1 = move? x_1

The improved pass runs to fixpoint, so we can flatten nested field accesses.

@rustbot
Copy link
Collaborator

rustbot commented Feb 5, 2023

r? @eholk

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 5, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot cjgillot added the A-mir-opt Area: MIR optimizations label Feb 5, 2023
) {
if lvalue.as_local().is_some() {
match rvalue {
// Aggregate assignments are expanded in run_pass.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-existing, but what does this comment mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Aggregate assignments are expanded in run_pass.
// `replace_flattened_locals` will expand those statements into fields,
// so we do not mark the lhs as non-splittable.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 6, 2023

I feel more motivated to try to land some of my unpublished branches for MirPatch improvements, but the PR looks good

@bors r+

@bors
Copy link
Contributor

bors commented Feb 6, 2023

📌 Commit 51ef82d has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 6, 2023
Rollup of 5 pull requests

Successful merges:

 - rust-lang#107553 (Suggest std::ptr::null if literal 0 is given to a raw pointer function argument)
 - rust-lang#107580 (Recover from lifetimes with default lifetimes in generic args)
 - rust-lang#107669 (rustdoc: combine duplicate rules in ayu CSS)
 - rust-lang#107685 (Suggest adding a return type for async functions)
 - rust-lang#107687 (Adapt SROA MIR opt for aggregated MIR)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e385ca2 into rust-lang:master Feb 6, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 6, 2023
@cjgillot cjgillot deleted the sroa-2 branch February 6, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants