Commit a52204c
committed
[Coro] Prebuild a module-level debug info set and share it between all coroutine clones
Summary:
CoroCloner, by calling into CloneFunctionInto, does a lot of repeated
work priming DIFinder and building a list of common module-level debug
info metadata. For programs compiled with full debug info this can get
very expensive.
This diff builds the data once and shares it between all clones.
Anecdata for a sample cpp source file compiled with full debug info:
| | Baseline | IdentityMD set | Prebuilt CommonDI (cur.) |
|-----------------|----------|----------------|--------------------------|
| CoroSplitPass | 306ms | 221ms | 68ms |
| CoroCloner | 101ms | 72ms | 0.5ms |
| CollectGlobalDI | - | - | 63ms |
| Speed up | 1x | 1.4x | 4.5x |
Note that CollectCommonDebugInfo happens once *per coroutine* rather than per clone.
Test Plan:
ninja check-llvm-unit
ninja check-llvm
Compiled a sample internal source file, checked time trace output for scope timings.
stack-info: PR: #118628, branch: users/artempyanykh/fast-coro-upstream/91 parent 210eee4 commit a52204c
2 files changed
+63
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | | - | |
| 66 | + | |
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
68 | | - | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | | - | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | | - | |
| 92 | + | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
92 | | - | |
| 98 | + | |
| 99 | + | |
93 | 100 | | |
94 | 101 | | |
95 | 102 | | |
| |||
129 | 136 | | |
130 | 137 | | |
131 | 138 | | |
132 | | - | |
133 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
140 | 148 | | |
141 | | - | |
| 149 | + | |
| 150 | + | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
145 | | - | |
| 154 | + | |
146 | 155 | | |
147 | 156 | | |
148 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
80 | 102 | | |
81 | 103 | | |
82 | 104 | | |
| |||
891 | 913 | | |
892 | 914 | | |
893 | 915 | | |
894 | | - | |
895 | | - | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
896 | 921 | | |
897 | 922 | | |
898 | 923 | | |
| |||
1374 | 1399 | | |
1375 | 1400 | | |
1376 | 1401 | | |
| 1402 | + | |
| 1403 | + | |
1377 | 1404 | | |
1378 | 1405 | | |
1379 | 1406 | | |
1380 | 1407 | | |
1381 | 1408 | | |
1382 | | - | |
| 1409 | + | |
| 1410 | + | |
1383 | 1411 | | |
1384 | | - | |
| 1412 | + | |
| 1413 | + | |
1385 | 1414 | | |
1386 | | - | |
| 1415 | + | |
| 1416 | + | |
1387 | 1417 | | |
1388 | 1418 | | |
1389 | 1419 | | |
| |||
1768 | 1798 | | |
1769 | 1799 | | |
1770 | 1800 | | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
1771 | 1804 | | |
1772 | 1805 | | |
1773 | 1806 | | |
1774 | 1807 | | |
1775 | 1808 | | |
1776 | | - | |
| 1809 | + | |
1777 | 1810 | | |
1778 | 1811 | | |
1779 | 1812 | | |
| |||
1899 | 1932 | | |
1900 | 1933 | | |
1901 | 1934 | | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
1902 | 1938 | | |
1903 | 1939 | | |
1904 | 1940 | | |
1905 | 1941 | | |
1906 | 1942 | | |
1907 | | - | |
| 1943 | + | |
1908 | 1944 | | |
1909 | 1945 | | |
1910 | 1946 | | |
| |||
0 commit comments