[PATCH] D84360: [LLD][PowerPC] Implement GOT to PC-Rel relaxation

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 22:37:02 PDT 2020


MaskRay added inline comments.


================
Comment at: lld/ELF/InputSection.cpp:1028
+      // and only relax the other if the saved offset matches.
+      if (type == R_PPC64_GOT_PCREL34)
+        lastPPCRelaxedRelocOff = offset;
----------------
This assumes that relocation types on other architectures (which are represented by LLD's R_RELAX_GOT_PC or R_RELAX_GOT_PC_NOPIC) do not use the value `R_PPC64_GOT_PCREL34`. This is a subtle assumption we want to avoid. I think we need a new RelExpr: R_PPC64_RELAX_GOT_PCREL34.


================
Comment at: lld/test/ELF/ppc64-got-to-pcrel-relaxation.s:168
+check_LWA_STW:
+  mr 9,3
+  pld 8,useVal_sint at got@pcrel(0),1
----------------
Can these unrelated instructions be removed? We just need prefixed instructions and for the `.reloc` case, one instruction before `.reloc`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84360/new/

https://reviews.llvm.org/D84360



More information about the llvm-commits mailing list