Commit bb168c9
PR #7799 added debug info for global variables across all inlined
subprograms, creating O(subprograms x globals) debug instructions. This
caused 2-3x slower compilation for shaders with many globals and
deeply-inlined functions.
Fix: Instead of collecting ALL subprograms for a function (walking every
instruction), only collect subprograms from the alloca's actual users --
the instructions that reference the specific global variable. This
preserves the debug info feature (globals visible in inlined scopes that
use them) while eliminating work for unrelated scopes.
The 'Lower static global into Alloca' pass is 3.8x faster on a stress
test (41ms -> 11ms), and overall debug compilation is ~10% faster.
Fixes #8174
Co-authored-by: Copilot <[email protected]>
1 parent cdbd4e6 commit bb168c9
1 file changed
Lines changed: 41 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6505 | 6505 | | |
6506 | 6506 | | |
6507 | 6507 | | |
6508 | | - | |
6509 | | - | |
| 6508 | + | |
| 6509 | + | |
6510 | 6510 | | |
6511 | 6511 | | |
| 6512 | + | |
| 6513 | + | |
| 6514 | + | |
| 6515 | + | |
| 6516 | + | |
| 6517 | + | |
| 6518 | + | |
| 6519 | + | |
| 6520 | + | |
| 6521 | + | |
| 6522 | + | |
| 6523 | + | |
| 6524 | + | |
| 6525 | + | |
| 6526 | + | |
| 6527 | + | |
| 6528 | + | |
| 6529 | + | |
6512 | 6530 | | |
6513 | 6531 | | |
6514 | | - | |
6515 | | - | |
6516 | | - | |
6517 | | - | |
6518 | | - | |
6519 | | - | |
6520 | | - | |
6521 | | - | |
6522 | | - | |
6523 | | - | |
6524 | | - | |
6525 | | - | |
6526 | | - | |
| 6532 | + | |
| 6533 | + | |
6527 | 6534 | | |
6528 | 6535 | | |
6529 | 6536 | | |
6530 | 6537 | | |
6531 | | - | |
6532 | | - | |
6533 | | - | |
6534 | | - | |
| 6538 | + | |
| 6539 | + | |
| 6540 | + | |
6535 | 6541 | | |
6536 | | - | |
6537 | | - | |
| 6542 | + | |
6538 | 6543 | | |
6539 | 6544 | | |
6540 | | - | |
| 6545 | + | |
6541 | 6546 | | |
6542 | 6547 | | |
6543 | 6548 | | |
6544 | | - | |
6545 | | - | |
6546 | | - | |
6547 | | - | |
6548 | | - | |
| 6549 | + | |
| 6550 | + | |
6549 | 6551 | | |
6550 | 6552 | | |
6551 | 6553 | | |
| |||
6771 | 6773 | | |
6772 | 6774 | | |
6773 | 6775 | | |
6774 | | - | |
6775 | | - | |
| 6776 | + | |
| 6777 | + | |
| 6778 | + | |
| 6779 | + | |
| 6780 | + | |
| 6781 | + | |
| 6782 | + | |
| 6783 | + | |
| 6784 | + | |
| 6785 | + | |
| 6786 | + | |
| 6787 | + | |
6776 | 6788 | | |
6777 | 6789 | | |
6778 | 6790 | | |
| |||
0 commit comments