[PATCH] D19040: Remove unnecessary load via GOT when accessing globals with PIE in x86_64

David Kreitzer via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 15:35:26 PDT 2016


DavidKreitzer added a subscriber: DavidKreitzer.

================
Comment at: lib/Target/X86/X86Subtarget.cpp:103
@@ -95,3 +102,3 @@
     // Extra load is needed for all externally visible.
     if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
       return X86II::MO_GOTOFF;
----------------
Do you want to fix the 32-bit case too? Under the same isPIEDefinition condition as in the 64-bit case, you can use X86II::MO_GOTOFF which also saves a load from the GOT.



http://reviews.llvm.org/D19040





More information about the llvm-commits mailing list