[all-commits] [llvm/llvm-project] 86c983: [ItaniumCXXABI] Don't mark an extern_weak init fun...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Mon Dec 23 02:14:05 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 86c9831bb40d2c50c36b748b08a75860c4640875
      https://github.com/llvm/llvm-project/commit/86c9831bb40d2c50c36b748b08a75860c4640875
  Author: Martin Storsjö <martin at martin.st>
  Date:   2019-12-23 (Mon, 23 Dec 2019)

  Changed paths:
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    A clang/test/CodeGenCXX/mingw-thread-local.cpp

  Log Message:
  -----------
  [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windows

Since 6bf108d77a3c, we try to not mark extern_weak symbols as
dso_local, to allow using COFF stubs for references to those symbols
(as the symbol may be missing, resolving to an absolute address zero,
outside of the current DSO).

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


  Commit: b774aa1011a031b225624277178382bb2db7e26a
      https://github.com/llvm/llvm-project/commit/b774aa1011a031b225624277178382bb2db7e26a
  Author: Martin Storsjö <martin at martin.st>
  Date:   2019-12-23 (Mon, 23 Dec 2019)

  Changed paths:
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/test/CodeGen/ARM/tail-call-weak.ll

  Log Message:
  -----------
  [ARM] [Windows] Use COFF stubs for calls to extern_weak functions

As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).

Instead check the shouldAssumeDSOLocal method and load the address
from a COFF stub.

This matches what was done for X86 in 6bf108d77a3c.

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


  Commit: 5a751e747dbf2c267e944aa961e21de7a815e7eb
      https://github.com/llvm/llvm-project/commit/5a751e747dbf2c267e944aa961e21de7a815e7eb
  Author: Martin Storsjö <martin at martin.st>
  Date:   2019-12-23 (Mon, 23 Dec 2019)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    M llvm/lib/Target/AArch64/AArch64FastISel.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64Subtarget.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call-weak.ll
    M llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
    A llvm/test/CodeGen/AArch64/windows-extern-weak.ll

  Log Message:
  -----------
  [AArch64] [Windows] Use COFF stubs for calls to extern_weak functions

As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).

Improve the classifyGlobalFunctionReference method to set
MO_DLLIMPORT/MO_COFFSTUB, and simplify the existing code in
AArch64TargetLowering::LowerCall to use the return value from
classifyGlobalFunctionReference for these cases.

Add code in both AArch64FastISel and GlobalISel/IRTranslator to
bail out for function calls to extern weak functions on windows,
to let SelectionDAG handle them.

This matches what was done for X86 in 6bf108d77a3c.

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


Compare: https://github.com/llvm/llvm-project/compare/cc522bc4e3e5...5a751e747dbf


More information about the All-commits mailing list