[PATCH] D15779: [ELF] - Implemented optimization for R_X86_64_GOTPCREL relocation.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 05:56:11 PST 2016


grimar added a comment.

In http://reviews.llvm.org/D15779#329436, @rafael wrote:

> Do you also intend to also implement the other optimizations listed in the ABI?


I have plan to implement all those which listed in "B.2 Optimize GOTPCRELX Relocations":
call *foo at GOTPCREL(%rip) -> nop call foo
call *foo at GOTPCREL(%rip) -> call foo nop
jmp *foo at GOTPCREL(%rip) -> jmp foo nop
mov foo at GOTPCREL(%rip), %reg -> lea foo(%rip), %reg (this patch implements it)

I have no any plans about any others optimizations.


================
Comment at: ELF/Target.cpp:664
@@ +663,3 @@
+    return false;
+  return (!Config->Shared || S.getVisibility() == STV_HIDDEN);
+}
----------------
rafael wrote:
> canBePreempted already checks this, no?
Looks like so, fixed.

================
Comment at: test/ELF/gotpc-relax-und-dso.s:24
@@ +23,3 @@
+// DISASM:      _start:
+// DISASM-NEXT:     1002: 48 8b 05 97 10 00 00 movq 4247(%rip), %rax
+// DISASM-NEXT:     1009: 48 8b 05 90 10 00 00 movq 4240(%rip), %rax
----------------
rafael wrote:
> Use {{.*}} instead of checking the bits.
I leaved bits specially here. I think for patches that emit binary data it is reasonable to check it.
For example the same instruction can be encoded in a different way. This one patch changes one byte and so I would like to check binary output as well as instructions generated.


http://reviews.llvm.org/D15779





More information about the llvm-commits mailing list