[PATCH] D60958: [PPC64] toc-indirect to toc-relative relaxation

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 00:06:56 PDT 2019


MaskRay created this revision.
MaskRay added reviewers: ruiu, sfertile, syzaara, rdhindsa.
Herald added subscribers: llvm-commits, jsji, kbarton, arichardson, nemanjai, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

This is based on D54720 <https://reviews.llvm.org/D54720> by Sean Fertile.

  addis 3, 2, .LC0 at toc@ha   # R_PPC64_TOC16_HA
  ld 3, .LC0 at toc@l(3)       # R_PPC64_TOC16_LO_DS
  
  .section .toc,"aw", at progbits
  .LC0: .tc aGlobal[TC],aGlobal

can be relaxed to

  addis 3,2,offset_ha # or nop
  addi 3,3,offset_l   # or addi 3,2,offset

This requires .LC0 to a defined non-preemptable symbol addressable with
32-bit signed offset from the toc pointer.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D60958

Files:
  ELF/Arch/PPC64.cpp
  ELF/Arch/X86_64.cpp
  ELF/InputSection.cpp
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Target.cpp
  ELF/Target.h
  test/ELF/Inputs/ppc64-global.s
  test/ELF/Inputs/ppc64-local.s
  test/ELF/Inputs/ppc64-toc-opt-defs.s
  test/ELF/Inputs/ppc64-toc-opt-shared.s
  test/ELF/ppc64-func-entry-points.s
  test/ELF/ppc64-got-indirect.s
  test/ELF/ppc64-relocs.s
  test/ELF/ppc64-toc-relax-jumptable.s
  test/ELF/ppc64-toc-relax.s
  test/ELF/ppc64-tocopt-constants-in-toc.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60958.196036.patch
Type: text/x-patch
Size: 29097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190422/f3f71fbf/attachment.bin>


More information about the llvm-commits mailing list