[all-commits] [llvm/llvm-project] c05126: [LLVM][LTO] Factor out RTLib calls and allow them ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jul 16 04:22:30 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c05126bdfc3b02daa37d11056fa43db1a6cdef69
      https://github.com/llvm/llvm-project/commit/c05126bdfc3b02daa37d11056fa43db1a6cdef69
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-07-16 (Tue, 16 Jul 2024)

  Changed paths:
    M lld/COFF/Driver.cpp
    M lld/ELF/Driver.cpp
    M lld/wasm/Driver.cpp
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
    A llvm/include/llvm/CodeGen/RuntimeLibcallUtil.h
    R llvm/include/llvm/CodeGen/RuntimeLibcalls.h
    M llvm/include/llvm/CodeGen/TargetLowering.h
    A llvm/include/llvm/IR/RuntimeLibcalls.h
    M llvm/include/llvm/LTO/LTO.h
    M llvm/lib/CodeGen/AtomicExpandPass.cpp
    M llvm/lib/CodeGen/DwarfEHPrepare.cpp
    M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
    M llvm/lib/CodeGen/TargetLoweringBase.cpp
    M llvm/lib/IR/CMakeLists.txt
    A llvm/lib/IR/RuntimeLibcalls.cpp
    M llvm/lib/LTO/LTO.cpp
    M llvm/lib/Object/IRSymtab.cpp
    M llvm/lib/Target/AArch64/AArch64FastISel.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/ARM/ARMFastISel.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/ARM/ARMLegalizerInfo.h
    M llvm/lib/Target/ARM/ARMSelectionDAGInfo.h
    M llvm/lib/Target/Hexagon/HexagonISelLowering.cpp
    M llvm/lib/Target/Lanai/LanaiISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/Mips/MipsISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.h
    M llvm/tools/lto/lto.cpp

  Log Message:
  -----------
  [LLVM][LTO] Factor out RTLib calls and allow them to be dropped (#98512)

Summary:
The LTO pass and LLD linker have logic in them that forces extraction
and prevent internalization of needed runtime calls. However, these
currently take all RTLibcalls into account, even if the target does not
support them. The target opts-out of a libcall if it sets its name to
nullptr. This patch pulls this logic out into a class in the header so
that LTO / lld can use it to determine if a symbol actually needs to be
kept.

This is important for targets like AMDGPU that want to be able to use
`lld` to perform the final link step, but does not want the overhead of
uncalled functions. (This adds like a second to the link time trivially)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list