]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #107687 - cjgillot:sroa-2, r=oli-obk
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Mon, 6 Feb 2023 14:24:15 +0000 (19:54 +0530)
committerGitHub <noreply@github.com>
Mon, 6 Feb 2023 14:24:15 +0000 (19:54 +0530)
Adapt SROA MIR opt for aggregated MIR

The pass was broken by https://github.com/rust-lang/rust/pull/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.


Trivial merge