Commit 5ce3495
authored
[Coro] Prebuild a module-level debug info set and share it between all coroutine clones (llvm#118628)
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 |
| CollectCommonDI | - | - | 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.1 parent 4831fa8 commit 5ce3495
2 files changed
+60
-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 | + | |
80 | 99 | | |
81 | 100 | | |
82 | 101 | | |
| |||
891 | 910 | | |
892 | 911 | | |
893 | 912 | | |
894 | | - | |
895 | | - | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
896 | 918 | | |
897 | 919 | | |
898 | 920 | | |
| |||
1374 | 1396 | | |
1375 | 1397 | | |
1376 | 1398 | | |
| 1399 | + | |
| 1400 | + | |
1377 | 1401 | | |
1378 | 1402 | | |
1379 | 1403 | | |
1380 | 1404 | | |
1381 | 1405 | | |
1382 | | - | |
| 1406 | + | |
| 1407 | + | |
1383 | 1408 | | |
1384 | | - | |
| 1409 | + | |
| 1410 | + | |
1385 | 1411 | | |
1386 | | - | |
| 1412 | + | |
| 1413 | + | |
1387 | 1414 | | |
1388 | 1415 | | |
1389 | 1416 | | |
| |||
1768 | 1795 | | |
1769 | 1796 | | |
1770 | 1797 | | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
1771 | 1801 | | |
1772 | 1802 | | |
1773 | 1803 | | |
1774 | 1804 | | |
1775 | 1805 | | |
1776 | | - | |
| 1806 | + | |
1777 | 1807 | | |
1778 | 1808 | | |
1779 | 1809 | | |
| |||
1899 | 1929 | | |
1900 | 1930 | | |
1901 | 1931 | | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
1902 | 1935 | | |
1903 | 1936 | | |
1904 | 1937 | | |
1905 | 1938 | | |
1906 | 1939 | | |
1907 | | - | |
| 1940 | + | |
1908 | 1941 | | |
1909 | 1942 | | |
1910 | 1943 | | |
| |||
0 commit comments