Commit dde0381
committed
Auto merge of #116042 - Nadrieril:linear-pass-take-2, r=<try>
[Experiment] Rewrite exhaustiveness in one pass
Arm reachability checking does a quadratic amount of work: for each arm we check if it is reachable given the arms above it. This feels wasteful since we often end up re-exploring the same cases when we check for exhaustiveness.
This PR is an attempt to check reachability at the same time as exhaustiveness. This opens the door to a bunch of code simplifications I'm very excited about. The main question is whether I can get actual performance gains out of this.
I had started the experiment in #111720 but I can't reopen it.
r? `@ghost`File tree
1 file changed
+5
-11
lines changed- compiler/rustc_mir_build/src/thir/pattern
1 file changed
+5
-11
lines changedLines changed: 5 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | 102 | | |
107 | 103 | | |
108 | 104 | | |
| |||
150 | 146 | | |
151 | 147 | | |
152 | 148 | | |
153 | | - | |
| 149 | + | |
154 | 150 | | |
155 | 151 | | |
156 | 152 | | |
| |||
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
174 | | - | |
| 170 | + | |
175 | 171 | | |
176 | 172 | | |
177 | 173 | | |
| |||
194 | 190 | | |
195 | 191 | | |
196 | 192 | | |
197 | | - | |
| 193 | + | |
198 | 194 | | |
199 | 195 | | |
200 | 196 | | |
| |||
221 | 217 | | |
222 | 218 | | |
223 | 219 | | |
224 | | - | |
| 220 | + | |
225 | 221 | | |
226 | 222 | | |
227 | 223 | | |
| |||
304 | 300 | | |
305 | 301 | | |
306 | 302 | | |
307 | | - | |
308 | | - | |
309 | 303 | | |
310 | 304 | | |
311 | 305 | | |
| |||
402 | 396 | | |
403 | 397 | | |
404 | 398 | | |
405 | | - | |
| 399 | + | |
406 | 400 | | |
407 | 401 | | |
408 | 402 | | |
| |||
0 commit comments