Commit e385ca2
authored
Rollup merge of rust-lang#107687 - cjgillot:sroa-2, r=oli-obk
Adapt SROA MIR opt for aggregated MIR
The pass was broken by rust-lang#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.File tree
21 files changed
+589
-313
lines changed- compiler
- rustc_mir_dataflow/src
- rustc_mir_transform/src
- tests/mir-opt
- const_prop
21 files changed
+589
-313
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
793 | | - | |
| 793 | + | |
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
| 827 | + | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
| |||
0 commit comments