[all-commits] [llvm/llvm-project] 821d28: RuntimeLibcalls: Remove incorrect sincospi from mo...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Nov 10 11:05:29 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 821d2825a4f782da3da3c03b8a002802bff4b95c
      https://github.com/llvm/llvm-project/commit/821d2825a4f782da3da3c03b8a002802bff4b95c
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2025-11-10 (Mon, 10 Nov 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/include/llvm/IR/RuntimeLibcalls.td
    M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    A llvm/test/CodeGen/AArch64/llvm.sincospi.error.ll
    M llvm/test/CodeGen/AArch64/llvm.sincospi.ll
    A llvm/test/CodeGen/ARM/llvm.sincospi.ll
    M llvm/test/CodeGen/PowerPC/llvm.sincos.ll
    A llvm/test/CodeGen/PowerPC/llvm.sincospi.ll
    A llvm/test/CodeGen/PowerPC/llvm.sincospi.ppcfp128.ll
    A llvm/test/CodeGen/X86/llvm.sincospi.ll

  Log Message:
  -----------
  RuntimeLibcalls: Remove incorrect sincospi from most targets (#166982)

sincospi/sincospif/sincospil does not appear to exist on common
targets. Darwin targets have __sincospi and __sincospif, so define
and use those implementations. I have no idea what version added
those calls, so I'm just guessing it's the same conditions as
__sincos_stret.

Most of this patch is working to preserve codegen when a vector
library is explicitly enabled. This only covers sleef and armpl,
as those are the only cases tested.

The multiple result libcalls have an aberrant process where the
legalizer looks for the scalar type's libcall in RuntimeLibcalls,
and then cross references TargetLibraryInfo to find a matching
vector call. This was unworkable in the sincospi case, since the
common case is there is no scalar call available. To preserve
codegen if the call is available, first try to match a libcall
with the vector type before falling back on the old scalar search.

Eventually all of this logic should be contained in RuntimeLibcalls,
without the link to TargetLibraryInfo. In principle we should perform
the same legalization logic as for an ordinary operation, trying
to find a matching subvector type with a libcall.



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