[llvm] ARM: Stop setting sincos_stret calling convention (PR #147457)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 20:48:42 PDT 2025
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/147457
This was going out of its way to explicitly mark these as
ARM_AAPCS_VFP. This has been explicitly set since 8b40366b54bd4,
where the commit message states that "sincos" (not sincos_stret)
has a special calling convention. However, that commit also sets
the calling convention for all libcalls to ARM_AAPCS_VFP, and
getEffectiveCallingConv returns the same for CCC anyway in tests
using isWatchABI triples.
The net result of this appears to be a change in behavior when
using -float-abi=soft with isWatchABI, which have no tests so
I assume this is a theoretical combination.
If I assert
if (getTargetMachine().getTargetTriple().isWatchABI()) {
assert(!useSoftFloat());
assert(getEffectiveCallingConv(CallingConv::C, false) == CallingConv::ARM_AAPCS_VFP);
}
Only 2 tests fail the second condition, which look like copy paste accidents
using v7k triples with linux and only needed a filler triple. This is a consequence
of strangely using the target architecture in place of the OS ABI check,
as was done in 042a6c1fe19caf48af7e287dc8f6fd5fec158093
>From d84dcbfea49fe2c94a8fcc35e4c27de549ff11ca Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Tue, 8 Jul 2025 12:29:34 +0900
Subject: [PATCH] ARM: Stop setting sincos_stret calling convention
This was going out of its way to explicitly mark these as
ARM_AAPCS_VFP. This has been explicitly set since 8b40366b54bd4,
where the commit message states that "sincos" (not sincos_stret)
has a special calling convention. However, that commit also sets
the calling convention for all libcalls to ARM_AAPCS_VFP, and
getEffectiveCallingConv returns the same for CCC anyway in tests
using isWatchABI triples.
The net result of this appears to be a change in behavior when
using -float-abi=soft with isWatchABI, which have no tests so
I assume this is a theoretical combination.
If I assert
if (getTargetMachine().getTargetTriple().isWatchABI()) {
assert(!useSoftFloat());
assert(getEffectiveCallingConv(CallingConv::C, false) == CallingConv::ARM_AAPCS_VFP);
}
Only 2 tests fail the second condition, which look like copy paste accidents
using v7k triples with linux and only needed a filler triple. This is a consequence
of strangely using the target architecture in place of the OS ABI check,
as was done in 042a6c1fe19caf48af7e287dc8f6fd5fec158093
---
llvm/lib/IR/RuntimeLibcalls.cpp | 6 ------
1 file changed, 6 deletions(-)
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 2cbc2cdb79685..45b778d61d8e0 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -365,12 +365,6 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
if (darwinHasSinCosStret(TT)) {
setLibcallImpl(RTLIB::SINCOS_STRET_F32, RTLIB::__sincosf_stret);
setLibcallImpl(RTLIB::SINCOS_STRET_F64, RTLIB::__sincos_stret);
- if (TT.isWatchABI()) {
- setLibcallImplCallingConv(RTLIB::__sincosf_stret,
- CallingConv::ARM_AAPCS_VFP);
- setLibcallImplCallingConv(RTLIB::__sincos_stret,
- CallingConv::ARM_AAPCS_VFP);
- }
}
if (darwinHasExp10(TT)) {
More information about the llvm-commits
mailing list