hanchenye-llvm-project/lld/ELF/Arch
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
..
AArch64.cpp [ELF] Add support for Armv5 and Armv6 compatible Thunks 2018-08-20 09:37:50 +00:00
AMDGPU.cpp AMDGPU/LLD: Handle R_AMDGPU_REL64 relocation 2018-06-11 21:42:53 +00:00
ARM.cpp [ELF] Add support for Armv5 and Armv6 compatible Thunks 2018-08-20 09:37:50 +00:00
AVR.cpp Rename SymbolBody -> Symbol 2017-11-03 21:21:47 +00:00
Hexagon.cpp [ELF][HEXAGON] Add R_HEX_11/10/9_X support 2018-08-27 12:55:28 +00:00
Mips.cpp [ELF][MIPS] Remove support for linking microMIPS 64-bit code 2018-07-06 05:50:41 +00:00
MipsArchTree.cpp [ELF][MIPS] Add mote tests on MipsArchTree routines, fix typos in error messages 2018-07-10 16:51:17 +00:00
PPC.cpp [ELF] Recommit 327248 with Arm using the .got for _GLOBAL_OFFSET_TABLE_ 2018-03-19 06:52:51 +00:00
PPC64.cpp [PPC64] Optimize redundant instructions in global access sequences. 2018-09-20 00:26:44 +00:00
RISCV.cpp Support RISC-V 2018-08-09 17:59:56 +00:00
SPARCV9.cpp Do not use template for check{Int,UInt,IntUInt,Alignment}. 2018-03-29 22:40:52 +00:00
X86.cpp Rename R_TLSGD/R_TLSLD to add _GOT_FROM_END. NFC. 2018-05-31 18:07:06 +00:00
X86_64.cpp [LLD] Update split stack support to handle more generic prologues. Improve error handling. Add test file for better code-coverage. Update tests to be more complete. 2018-08-02 18:13:40 +00:00