[llvm] r357535 - [COFF] Reduce the size of Chunk and SectionChunk, NFC

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 15:11:58 PDT 2019


Author: rnk
Date: Tue Apr  2 15:11:58 2019
New Revision: 357535

URL: http://llvm.org/viewvc/llvm-project?rev=357535&view=rev
Log:
[COFF] Reduce the size of Chunk and SectionChunk, NFC

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

Modified:
    llvm/trunk/include/llvm/BinaryFormat/COFF.h

Modified: llvm/trunk/include/llvm/BinaryFormat/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/COFF.h?rev=357535&r1=357534&r2=357535&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/COFF.h (original)
+++ llvm/trunk/include/llvm/BinaryFormat/COFF.h Tue Apr  2 15:11:58 2019
@@ -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,




More information about the llvm-commits mailing list