Commit 60bd610
authored
[NFC] Avoid quadratic time in StackIROptimizer::removeUnneededBlocks() (#6859)
This is in quite ancient code, so it's a long-standing issue, but it got worse
when we enabled StackIR in more situations (#6568), which made it more
noticeable, I think.
For example, testing on test_biggerswitch in Emscripten, the LLVM part
is pretty slow too so the Binaryen slowdown didn't stand out hugely, but
just doing
wasm-opt --optimize-level=2 input.wasm -o output.wasm
(that is, do no work, but set the optimize level to 2 so that StackIR opts
are run) used to take 28 seconds (!). With this PR that goes down to less
than 1.1 parent 692e55c commit 60bd610
1 file changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
277 | 287 | | |
278 | 288 | | |
279 | 289 | | |
280 | 290 | | |
281 | 291 | | |
282 | | - | |
| 292 | + | |
283 | 293 | | |
284 | 294 | | |
285 | 295 | | |
| |||
0 commit comments