[PATCH] D114656: [ELF][PPC64] Remove unneeded PPC64PCRelLongBranchThunk

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 08:54:36 PST 2021


NeHuang added inline comments.


================
Comment at: lld/ELF/Thunks.cpp:985
 void PPC64R12SetupStub::addSymbols(ThunkSection &isec) {
-  addSymbol(saver.save("__gep_setup_" + destination.getName()), STT_FUNC, 0,
-            isec);
+  addSymbol(saver.save("__long_branch_pcrel_" + destination.getName()),
+            STT_FUNC, 0, isec);
----------------
NeHuang wrote:
> nemanjai wrote:
> > I am really not a fan of the name. The reason we emit this has nothing to do with long branches and the code we emit is not necessarily PC-Relative.
> > 
> > We emit this thunk when we need to branch to a GEP (Global Entry Point) of local function `Function1` simply because the caller doesn't maintain a TOC pointer and `Function1` does.
> > 
> > The existing name makes sense because the GEP assumes that `r12` contains the address of the GEP itself (i.e. at the first instruction in the GEP, `r12 == pc`).
> +1, the existing name makes more sense which is consistent the functionality of the thunk. Would be better we keep `__gep_setup_` as the name.
Just noticed `(s.stOther >> 5) > 1` got removed. LGTM and approved. Thank you for fixing it,


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114656



More information about the llvm-commits mailing list