[all-commits] [llvm/llvm-project] 6a2850: [AArch64][ELF] Prefer to lower MC_GlobalAddress op...

Fangrui Song via All-commits all-commits at lists.llvm.org
Fri May 7 09:44:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a2850f3fc24cc53da6543ee98bd837007c65725
      https://github.com/llvm/llvm-project/commit/6a2850f3fc24cc53da6543ee98bd837007c65725
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-05-07 (Fri, 07 May 2021)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
    M llvm/lib/Target/AArch64/AArch64MCInstLower.cpp
    M llvm/test/CodeGen/AArch64/basic-pic.ll
    M llvm/test/CodeGen/AArch64/elf-globals-static.ll
    A llvm/test/CodeGen/AArch64/elf-preemption.ll
    A llvm/test/CodeGen/AArch64/semantic-interposition-asm.ll

  Log Message:
  -----------
  [AArch64][ELF] Prefer to lower MC_GlobalAddress operands to .Lfoo$local

Similar to X86 D73230 & 46788a21f9152be3950e57dc526454655682bdd4

With this change, we can set dso_local in clang's -fpic -fno-semantic-interposition mode,
for default visibility external linkage non-ifunc-non-COMDAT definitions.

For such dso_local definitions, variable access/taking the address of a
function/calling a function will go through a local alias to avoid GOT/PLT.

Note: the 'S' inline assembly constraint refers to an absolute symbolic address
or a label reference (D46745).

Differential Revision: https://reviews.llvm.org/D101872




More information about the All-commits mailing list