This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit 63ac52a
committed
Auto merge of rust-lang#125916 - tesuji:mir-opt-const-array-locals, r=<try>
[WIP] mir-opt: promoting const read-only arrays
Modified from a copy of PromoteTemps. It's kind of a hack so nothing fancy or easy to follow and review.
I'll to reuse structures from PromoteTemps when there is [consensus for this pass][zulip].
Compiler is doing more work now with this opt. So I don't think this pass improves compiler performance.
But anyway, for statistics, can I get a perf run?
cc rust-lang#73825
r? ghost
### Current status
- [ ] Waiting for [consensus][zulip].
- [ ] Maybe rewrite to [use GVN with mentor from oli][mentor]
- [x] ~ICE on unstable feature: tests/assembly/simd-intrinsic-mask-load.rs#x86-avx512.~
In particular `Simd([literal array])` now transformed to `Simd(array_var)`. Maybe I should ignore array in constructor.
- [x] *~Fail test on nested arrays~*
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/136281-t-opsem/topic/Could.20const.20read-only.20arrays.20be.20const.20promoted.3F
[mentor]: rust-lang#125916 (comment)File tree
6 files changed
+1339
-15
lines changed- compiler/rustc_mir_transform/src
- library/panic_unwind
- tests/mir-opt
6 files changed
+1339
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| 346 | + | |
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
348 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
349 | 356 | | |
350 | 357 | | |
351 | 358 | | |
352 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
353 | 362 | | |
354 | 363 | | |
355 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | | - | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
112 | 120 | | |
113 | 121 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
123 | | - | |
| 127 | + | |
124 | 128 | | |
125 | 129 | | |
126 | | - | |
127 | | - | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
137 | 140 | | |
138 | 141 | | |
139 | 142 | | |
140 | | - | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| |||
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
972 | 976 | | |
973 | 977 | | |
974 | 978 | | |
975 | | - | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
976 | 985 | | |
977 | 986 | | |
978 | 987 | | |
| |||
0 commit comments