diff options
author | Reid Kleckner <rnk@google.com> | 2018-12-18 01:14:05 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-12-18 01:14:05 +0000 |
commit | 53ce05960e851bf46caf5b4a8d209f16836b2f89 (patch) | |
tree | de83b4a80672494195324bc4fde93bc777e3406d /llvm/test/DebugInfo/COFF/simple.ll | |
parent | c4e08feb002ffc32d0f37505134c4eddb1a784f7 (diff) | |
download | bcm5719-llvm-53ce05960e851bf46caf5b4a8d209f16836b2f89.tar.gz bcm5719-llvm-53ce05960e851bf46caf5b4a8d209f16836b2f89.zip |
[codeview] Align symbol records to save 441MB during linking clang.pdb
In PDBs, symbol records must be aligned to four bytes. However, in the
object file, symbol records may not be aligned. MSVC does not pad out
symbol records to make sure they are aligned. That means the linker has
to do extra work to insert the padding. Currently, LLD calculates the
required space with alignment, and copies each record one at a time
while padding them out to the correct size. It has a fast path that
avoids this copy when the records are already aligned.
This change fixes a bug in that codepath so that the copy is actually
saved, and tweaks LLVM's symbol record emission to align symbol records.
Here's how things compare when doing a plain clang Release+PDB build:
- objs are 0.65% bigger (negligible)
- link is 3.3% faster (negligible)
- saves allocating 441MB
- new LLD high water mark is ~1.05GB
llvm-svn: 349431
Diffstat (limited to 'llvm/test/DebugInfo/COFF/simple.ll')
-rw-r--r-- | llvm/test/DebugInfo/COFF/simple.ll | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/test/DebugInfo/COFF/simple.ll b/llvm/test/DebugInfo/COFF/simple.ll index 3c495a33b8a..58d0f42a67a 100644 --- a/llvm/test/DebugInfo/COFF/simple.ll +++ b/llvm/test/DebugInfo/COFF/simple.ll @@ -58,6 +58,7 @@ ; X86-NEXT: .secidx _f ; X86-NEXT: .byte 0 ; X86-NEXT: .asciz "f" +; X86-NEXT: .p2align 2 ; X86-NEXT: [[PROC_SEGMENT_END]]: ; X86-NEXT: .short [[FPROC_END:[^ ]*]]-[[FPROC_BEG:[^ ]*]] # Record length ; X86-NEXT: [[FPROC_BEG]]: @@ -69,6 +70,7 @@ ; X86-NEXT: .long 0 # Exception handler offset ; X86-NEXT: .short 0 # Exception handler section ; X86-NEXT: .long 0 # Flags (defines frame register) +; X86-NEXT: .p2align 2 ; X86-NEXT: [[FPROC_END]]: ; X86-NEXT: .short 2 ; X86-NEXT: .short 4431 @@ -89,8 +91,8 @@ ; OBJ32-NEXT: 0x44 IMAGE_REL_I386_DIR32NB _f ; OBJ32-NEXT: 0x90 IMAGE_REL_I386_SECREL _f ; OBJ32-NEXT: 0x94 IMAGE_REL_I386_SECTION _f -; OBJ32-NEXT: 0xC4 IMAGE_REL_I386_SECREL _f -; OBJ32-NEXT: 0xC8 IMAGE_REL_I386_SECTION _f +; OBJ32-NEXT: 0xC8 IMAGE_REL_I386_SECREL _f +; OBJ32-NEXT: 0xCC IMAGE_REL_I386_SECTION _f ; OBJ32-NEXT: ] ; OBJ32: Subsection [ ; OBJ32-NEXT: SubSectionType: Symbols (0xF1) @@ -184,6 +186,7 @@ ; X64-NEXT: .secidx f ; X64-NEXT: .byte 0 ; X64-NEXT: .asciz "f" +; X64-NEXT: .p2align 2 ; X64-NEXT: [[PROC_SEGMENT_END]]: ; X64-NEXT: .short [[FPROC_END:[^ ]*]]-[[FPROC_BEG:[^ ]*]] # Record length ; X64-NEXT: [[FPROC_BEG]]: @@ -195,6 +198,7 @@ ; X64-NEXT: .long 0 # Exception handler offset ; X64-NEXT: .short 0 # Exception handler section ; X64-NEXT: .long 81920 # Flags (defines frame register) +; X64-NEXT: .p2align 2 ; X64-NEXT: [[FPROC_END]]: ; X64-NEXT: .short 2 ; X64-NEXT: .short 4431 @@ -214,8 +218,8 @@ ; OBJ64: Relocations [ ; OBJ64-NEXT: 0x64 IMAGE_REL_AMD64_SECREL f ; OBJ64-NEXT: 0x68 IMAGE_REL_AMD64_SECTION f -; OBJ64-NEXT: 0x98 IMAGE_REL_AMD64_SECREL f -; OBJ64-NEXT: 0x9C IMAGE_REL_AMD64_SECTION f +; OBJ64-NEXT: 0x9C IMAGE_REL_AMD64_SECREL f +; OBJ64-NEXT: 0xA0 IMAGE_REL_AMD64_SECTION f ; OBJ64-NEXT: ] ; OBJ64: Subsection [ ; OBJ64-NEXT: SubSectionType: Symbols (0xF1) |