[llvm] r273868 - Add an explanation on how mips is special in here.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 06:10:46 PDT 2016


On Mon, Jun 27, 2016 at 2:33 PM, Rafael Espindola via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rafael
> Date: Mon Jun 27 07:33:33 2016
> New Revision: 273868
>
> URL: http://llvm.org/viewvc/llvm-project?rev=273868&view=rev
> Log:
> Add an explanation on how mips is special in here.
>
> Modified:
>     llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
>
> Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=273868&r1=273867&r2=273868&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
> +++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Jun 27 07:33:33 2016
> @@ -1764,6 +1764,17 @@ SDValue MipsTargetLowering::lowerGlobalA
>      return getAddrNonPIC(N, SDLoc(N), Ty, DAG);
>    }
>
> +  // Every other architecture would use shouldAssumeDSOLocal in here, but
> +  // mips is special.
> +  // * In PIC code mips requires got loads oven for local statics!

Typo: oven

> +  // * To save on got entries, for local statics the got entry contains the
> +  //   page and an additional add instruction takes care of the low bits.
> +  // * It is legal to access a hidden symbol with a non hidden undefined,
> +  //   so one cannot guarantee that all access to a hidden symbol will know
> +  //   it is hidden.
> +  // * Mips linkers don't support creating a page and a full got entry for
> +  //   the same symbol.
> +  // * Given all that, we have to use a full got entry for hidden symbols :-(
>    if (GV->hasLocalLinkage())
>      return getAddrLocal(N, SDLoc(N), Ty, DAG, ABI.IsN32() || ABI.IsN64());
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list