[all-commits] [llvm/llvm-project] 201572: [AArch64] Implement -fno-plt for SelectionDAG/Glob...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Mar 5 13:55:40 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 201572e34b2cb0861a60e00fd7dc2965e6af1587
      https://github.com/llvm/llvm-project/commit/201572e34b2cb0861a60e00fd7dc2965e6af1587
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
    M llvm/lib/Target/AArch64/AArch64FastISel.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64Subtarget.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
    M llvm/test/CodeGen/AArch64/call-rv-marker.ll
    M llvm/test/CodeGen/AArch64/nonlazybind.ll

  Log Message:
  -----------
  [AArch64] Implement -fno-plt for SelectionDAG/GlobalISel

Clang sets the nonlazybind attribute for certain ObjC features. The
AArch64 SelectionDAG implementation for non-intrinsic calls
(46e36f0953aabb5e5cd00ed8d296d60f9f71b424) is behind a cl option.

GCC implements -fno-plt for a few ELF targets. In Clang, -fno-plt also
sets the nonlazybind attribute. For SelectionDAG, make the cl option not
affect ELF so that non-intrinsic calls to a dso_preemptable function use
GOT. Adjust AArch64TargetLowering::LowerCall to handle intrinsic calls.

For FastISel, change `fastLowerCall` to bail out when a call is due to
-fno-plt.

For GlobalISel, handle non-intrinsic calls in CallLowering::lowerCall
and intrinsic calls in AArch64CallLowering::lowerCall (where the
target-independent CallLowering::lowerCall is not called).
The GlobalISel test in `call-rv-marker.ll` is therefore updated.

Note: the current -fno-plt -fpic implementation does not use GOT for a
preemptable function.

Link: #78275

Pull Request: https://github.com/llvm/llvm-project/pull/78890



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