Commit 97b2903
authored
[NFCI][WPD]Use unique string saver to store type id (llvm#106932)
Currently, both
[TypeIdMap](https://github.com/llvm/llvm-project/blob/67a1fdb014790a38a205d28e1748634de34471dd/llvm/include/llvm/IR/ModuleSummaryIndex.h#L1356)
and
[TypeIdCompatibleVtableMap](https://github.com/llvm/llvm-project/blob/67a1fdb014790a38a205d28e1748634de34471dd/llvm/include/llvm/IR/ModuleSummaryIndex.h#L1363)
keep type-id as `std::string` in the combined index for LTO indexing
analysis.
With this change, index uses a unique-string-saver to own the string
copies and two maps above can use string references to save some memory.
This shows a 3% memory reduction (from 8.2GiB to 7.9GiB) in an internal
binary with high indexing memory usage.1 parent a6fefc8 commit 97b2903
File tree
3 files changed
+30
-12
lines changed- llvm
- include/llvm/IR
- lib/Bitcode/Writer
3 files changed
+30
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | | - | |
| 1318 | + | |
1319 | 1319 | | |
1320 | 1320 | | |
1321 | 1321 | | |
| |||
1351 | 1351 | | |
1352 | 1352 | | |
1353 | 1353 | | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1354 | 1357 | | |
1355 | 1358 | | |
1356 | 1359 | | |
| |||
1359 | 1362 | | |
1360 | 1363 | | |
1361 | 1364 | | |
1362 | | - | |
| 1365 | + | |
1363 | 1366 | | |
1364 | 1367 | | |
1365 | 1368 | | |
| |||
1455 | 1458 | | |
1456 | 1459 | | |
1457 | 1460 | | |
1458 | | - | |
1459 | | - | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
1460 | 1464 | | |
1461 | 1465 | | |
1462 | 1466 | | |
| |||
1829 | 1833 | | |
1830 | 1834 | | |
1831 | 1835 | | |
1832 | | - | |
1833 | | - | |
| 1836 | + | |
| 1837 | + | |
1834 | 1838 | | |
1835 | 1839 | | |
1836 | 1840 | | |
| |||
1859 | 1863 | | |
1860 | 1864 | | |
1861 | 1865 | | |
1862 | | - | |
| 1866 | + | |
1863 | 1867 | | |
1864 | 1868 | | |
1865 | 1869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
331 | 345 | | |
332 | 346 | | |
333 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4165 | 4165 | | |
4166 | 4166 | | |
4167 | 4167 | | |
4168 | | - | |
| 4168 | + | |
4169 | 4169 | | |
4170 | 4170 | | |
4171 | 4171 | | |
| |||
4184 | 4184 | | |
4185 | 4185 | | |
4186 | 4186 | | |
4187 | | - | |
| 4187 | + | |
4188 | 4188 | | |
4189 | 4189 | | |
4190 | 4190 | | |
| |||
0 commit comments