]> granicus.if.org Git - llvm/commitdiff
[COFF] Reduce the size of Chunk and SectionChunk, NFC
authorReid Kleckner <rnk@google.com>
Tue, 2 Apr 2019 22:11:58 +0000 (22:11 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 2 Apr 2019 22:11:58 +0000 (22:11 +0000)
Summary:
Reorder the fields in both to use padding more efficiently, and add more
comments on the purpose of the fields.

Replace `std::vector<SectionChunk*> AssociativeChildren` with a
singly-linked list. This avoids the separate vector allocation to list
associative children, and shrinks the 3 pointers used for the typically
empty vector down to 1.

In the end, this reduces the sum of heap allocations used to link
browser_tests.exe with NO PDB by 13.10%, going from 2,248,728 KB to
1,954,071 KB of heap. These numbers exclude memory mapped files, which
are of course a significant factor in LLD's memory usage.

Reviewers: ruiu, mstorsjo, aganea

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59797

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357535 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/BinaryFormat/COFF.h

index e0543dea4c20084dbfeedf52c90ab21d9ab613b5..0fe38a43772536d899e0db14e7bc43dda952d9bd 100644 (file)
@@ -402,7 +402,7 @@ enum RelocationTypesARM64 : unsigned {
   IMAGE_REL_ARM64_REL32 = 0x0011,
 };
 
-enum COMDATType : unsigned {
+enum COMDATType : uint8_t {
   IMAGE_COMDAT_SELECT_NODUPLICATES = 1,
   IMAGE_COMDAT_SELECT_ANY,
   IMAGE_COMDAT_SELECT_SAME_SIZE,