[PATCH] D20793: [ELF] - Implemented support for test/binop relaxations from latest ABI.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon May 30 09:42:48 PDT 2016


grimar created this revision.
grimar added reviewers: rafael, ruiu.
grimar added subscribers: llvm-commits, grimar.

Patch implements next relaxation from latest ABI:

"Convert memory operand of test and binop into immediate operand, where binop is one of adc, add, and, cmp, or,
sbb, sub, xor instructions, when position-independent code is disabled."

It is described in System V Application Binary Interface AMD64 Architecture Processor 
Supplement Draft Version 0.99.8 (https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf, 
B.2 "B.2 Optimize GOTPCRELX Relocations").

Note: because of broken llvm-mc atm (https://llvm.org/bugs/show_bug.cgi?id=27939),
it uses precompiled binary produced by gas as input. 

So this patch sgould finalize the cycle, it implements the last set of possible relaxations.

http://reviews.llvm.org/D20793

Files:
  ELF/InputSection.cpp
  ELF/Relocations.cpp
  ELF/Relocations.h
  ELF/Target.cpp
  ELF/Target.h
  test/ELF/Inputs/gotpc-relax-nopic.o
  test/ELF/gotpc-relax-nopic.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20793.58971.patch
Type: text/x-patch
Size: 14995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160530/43b66d21/attachment.bin>


More information about the llvm-commits mailing list