]> git.lizzy.rs Git - rust.git/commit
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)
commite385ca25be4e6893228bcc7b9c6020e98a0742ad
tree130d103cd9469f301547256a76780755f1613d17
parent675976eb21dda25e017a1241fe1fefb53f88aad5
parent51ef82d19ba97fd60d13d02f708fd0eb43617cc7
Rollup merge of #107687 - cjgillot:sroa-2, r=oli-obk

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.