Commit b0d35cf
authored
[SSAUpdater] Avoid scanning basic blocks to find instruction order. (#123803)
This fixes a compile-time regression caused by #116645, where an entry
basic block with a very large number of allocas and other instructions
caused SROA to take ~100× its expected runtime, as every alloca (with ~2
uses) now calls this method to find the order of those few instructions,
rescanning the very large basic block every single time.
Since this code was originally written, Instructions now have ordering
numbers available to determine relative order without unnecessarily
scanning the basic block.1 parent 6b486f4 commit b0d35cf
File tree
2 files changed
+12
-29
lines changed- llvm
- include/llvm/Transforms/Utils
- lib/Transforms/Utils
2 files changed
+12
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | 167 | | |
175 | 168 | | |
176 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
436 | | - | |
437 | | - | |
| 435 | + | |
438 | 436 | | |
439 | 437 | | |
440 | 438 | | |
441 | 439 | | |
442 | 440 | | |
443 | 441 | | |
444 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
445 | 449 | | |
446 | 450 | | |
447 | 451 | | |
448 | 452 | | |
449 | | - | |
| 453 | + | |
450 | 454 | | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
| 455 | + | |
| 456 | + | |
456 | 457 | | |
457 | 458 | | |
458 | 459 | | |
| |||
465 | 466 | | |
466 | 467 | | |
467 | 468 | | |
468 | | - | |
469 | | - | |
470 | | - | |
| 469 | + | |
471 | 470 | | |
472 | 471 | | |
473 | 472 | | |
474 | 473 | | |
475 | | - | |
| 474 | + | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | | - | |
480 | 477 | | |
481 | 478 | | |
482 | 479 | | |
| |||
533 | 530 | | |
534 | 531 | | |
535 | 532 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
0 commit comments