hanchenye-llvm-project/lld/ELF
Sean Fertile 7f3f05e0b7 [PPC64] Optimize redundant instructions in global access sequences.
The access sequence for global variables in the medium and large code models use
2 instructions to add an offset to the toc-pointer. If the offset fits whithin
16-bits then the instruction that sets the high 16 bits is redundant.

This patch adds the --toc-optimize option, (on by default) and enables rewriting
of 2 instruction global variable accesses into 1 when the offset from the
TOC-pointer to the variable (or .got entry) fits in 16 signed bits. eg

addis %r3, %r2, 0           -->     nop
addi  %r3, %r3, -0x8000     -->     addi %r3, %r2, -0x8000

This rewriting can be disabled with the --no-toc-optimize flag

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

llvm-svn: 342602
2018-09-20 00:26:44 +00:00
..
Arch [PPC64] Optimize redundant instructions in global access sequences. 2018-09-20 00:26:44 +00:00
AArch64ErrataFix.cpp [ELF] Guard --fix-cortex-a53-843419 against --just-syms 2018-09-13 15:49:13 +00:00
AArch64ErrataFix.h Consistent (non) use of empty lines in include blocks 2018-02-20 21:53:18 +00:00
Bits.h Move bit operations to a new file, ELF/Bits.h. 2017-10-26 21:37:17 +00:00
CMakeLists.txt Rename GdbIndex.{cpp,h} -> DWARF.{cpp,h}. 2018-09-14 23:51:05 +00:00
CallGraphSort.cpp [LLD][ELF] - Simplify Call-Chain Clustering implementation a bit. 2018-08-28 08:49:40 +00:00
CallGraphSort.h [ELF] Add profile guided section layout 2018-04-17 23:30:05 +00:00
Config.h [PPC64] Optimize redundant instructions in global access sequences. 2018-09-20 00:26:44 +00:00
DWARF.cpp Rename GdbIndex.{cpp,h} -> DWARF.{cpp,h}. 2018-09-14 23:51:05 +00:00
DWARF.h Style fix. NFC. 2018-09-14 23:51:17 +00:00
Driver.cpp [PPC64] Optimize redundant instructions in global access sequences. 2018-09-20 00:26:44 +00:00
Driver.h Add TARGET(foo) linker script directive. 2018-08-06 21:29:41 +00:00
DriverUtils.cpp [ELF] Use search paths for --version-script= 2018-07-25 21:53:18 +00:00
EhFrame.cpp [ELF] Simplify read32. NFC 2018-03-30 23:13:00 +00:00
EhFrame.h De-template EhReader. NFC. 2017-10-27 03:14:09 +00:00
Filesystem.cpp s/LLVM_ON_WIN32/_WIN32/, lld 2018-04-10 13:15:21 +00:00
Filesystem.h Add a missing #include. 2017-11-17 08:17:21 +00:00
ICF.cpp ELF: Don't examine values of linker script symbols during ICF. 2018-08-29 23:43:38 +00:00
ICF.h Consistent use of header file for ICF and MarkLive 2018-02-20 22:09:59 +00:00
InputFiles.cpp [ELF] Check if LinkSec is nullptr when initializing SHF_LINK_ORDER sections 2018-09-07 00:18:07 +00:00
InputFiles.h Change how we handle -wrap. 2018-08-22 07:02:26 +00:00
InputSection.cpp When a relocation to an undefined symbol is an R_X86_64_PC32, an input 2018-09-04 21:06:59 +00:00
InputSection.h Revert r342297: Discard uncompressed buffer after creating .gdb_index contents. 2018-09-14 23:28:13 +00:00
LTO.cpp Simplify. 2018-09-11 14:37:27 +00:00
LTO.h Simplify. 2018-09-11 14:37:27 +00:00
LinkerScript.cpp ELF: Don't examine values of linker script symbols during ICF. 2018-08-29 23:43:38 +00:00
LinkerScript.h [ELF] - Eliminate the AssertCommand. 2018-04-25 11:16:31 +00:00
MapFile.cpp [ELF] - Change dyn_cast to cast. NFC. 2018-07-02 08:26:20 +00:00
MapFile.h Implement --cref. 2018-03-14 20:29:45 +00:00
MarkLive.cpp [ELF] Pass callables by function_ref 2018-06-16 12:11:34 +00:00
MarkLive.h Consistent use of header file for ICF and MarkLive 2018-02-20 22:09:59 +00:00
Options.td [PPC64] Optimize redundant instructions in global access sequences. 2018-09-20 00:26:44 +00:00
OutputSections.cpp [ELF] Pass callables by function_ref 2018-06-16 12:11:34 +00:00
OutputSections.h [ELF] - Implement linker script OVERLAYs. 2018-06-27 08:08:12 +00:00
README.md
Relocations.cpp [PPC64] Add TLS initial exec to local exec relaxation 2018-08-21 15:13:53 +00:00
Relocations.h [PPC64] Add TLS initial exec to local exec relaxation 2018-08-21 15:13:53 +00:00
ScriptLexer.cpp [LLD][ELD] - Do not reject INFO output section type when used with a start address. 2018-08-28 08:39:21 +00:00
ScriptLexer.h [LLD][ELD] - Do not reject INFO output section type when used with a start address. 2018-08-28 08:39:21 +00:00
ScriptParser.cpp [LLD][ELD] - Do not reject INFO output section type when used with a start address. 2018-08-28 08:39:21 +00:00
ScriptParser.h [ELF] Support expressions with -defsym option 2017-11-04 02:03:58 +00:00
SymbolTable.cpp Change how we handle -wrap. 2018-08-22 07:02:26 +00:00
SymbolTable.h Change how we handle -wrap. 2018-08-22 07:02:26 +00:00
Symbols.cpp [ELF] Set Out::TlsPhdr earlier for encoding packed reloc tables 2018-09-18 00:24:48 +00:00
Symbols.h [ELF] Revert "Also demote lazy symbols." 2018-09-11 23:00:36 +00:00
SyntheticSections.cpp [ELF] Use llvm::toLower instead of libc call tolower 2018-09-15 23:59:13 +00:00
SyntheticSections.h Rename GdbIndex.{cpp,h} -> DWARF.{cpp,h}. 2018-09-14 23:51:05 +00:00
Target.cpp Support RISC-V 2018-08-09 17:59:56 +00:00
Target.h [ELF] Add support for Armv5 and Armv6 compatible Thunks 2018-08-20 09:37:50 +00:00
Thunks.cpp [ELF] [ARM] Don't mix 'ip' and 'r12' as names for the same register in comments. NFC. 2018-08-31 08:03:33 +00:00
Thunks.h ELF: Allow thunks to change size. NFCI. 2018-03-29 22:32:13 +00:00
Writer.cpp [ELF] Set Out::TlsPhdr earlier for encoding packed reloc tables 2018-09-18 00:24:48 +00:00
Writer.h ELF: Do not ICF two sections with different output sections. 2018-05-23 01:58:43 +00:00

README.md

See docs/NewLLD.rst