[PATCH] D96035: [dsymutil][DWARFlinker] implement separate multi-thread processing for compile units.
Greg Clayton via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 16:54:28 PST 2022
clayborg added a comment.
Looking at a few normal CUs after this I see that there are a lot of imported declarations we can probably get rid of if no one references them:
0x04517e06: DW_TAG_namespace
DW_AT_name ("std")
0x04517e0b: DW_TAG_namespace
DW_AT_name ("__1")
DW_AT_export_symbols (true)
0x04517e10: DW_TAG_namespace
DW_AT_name ("chrono")
0x04517e15: DW_TAG_imported_module
DW_AT_decl_file ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/chrono")
DW_AT_decl_line (2923)
DW_AT_import (0x0000000001b05f36)
0x04517e1d: NULL
0x04517e1e: DW_TAG_imported_declaration
DW_AT_decl_file ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/cstddef")
DW_AT_decl_line (49)
DW_AT_import (0x0000000003fe0299)
0x04517e25: DW_TAG_imported_declaration
DW_AT_decl_file ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/cstddef")
DW_AT_decl_line (50)
DW_AT_import (0x0000000003fe0375)
0x04517e2c: DW_TAG_imported_declaration
DW_AT_decl_file ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/cstddef")
DW_AT_decl_line (53)
DW_AT_import (0x0000000003fe019b)
0x04517e33: DW_TAG_imported_declaration
DW_AT_decl_file ("/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/cstdlib")
DW_AT_decl_line (99)
DW_AT_import (0x0000000003fe0375)
... <many many more>
These imported declarations amounted to 3% of overall CU size for a single compile unit that I tested. I know that the stock dsymutil whitelists all of these which causes these and all the types the reference to be kept, so if we can get rid of any DW_TAG_imported_declaration DIEs that are not referenced, we might also be able to get rid of the type that they reference as well as all types from a C++ header file that have corresponding C header files like "cstdlib" -> "stdlib.h", they will have this issue and waste space.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96035/new/
https://reviews.llvm.org/D96035
More information about the llvm-commits
mailing list