[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/dpaoliello approved this pull request. https://github.com/llvm/llvm-project/pull/143081 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From fc327d3a766b53cf4f3b57680684924fec73ab21 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 45826fcd19f38..d8f467e30fa6a 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -116,7 +116,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -131,6 +131,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index b561dafa81ce3..000414c6d91cc 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -388,7 +388,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -432,8 +432,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From fc327d3a766b53cf4f3b57680684924fec73ab21 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 45826fcd19f38..d8f467e30fa6a 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -116,7 +116,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -131,6 +131,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index b561dafa81ce3..000414c6d91cc 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -388,7 +388,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -432,8 +432,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/efriedma-quic approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/143081 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From 30983d1ad907744cac767a4f39c012a667db20c6 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 45826fcd19f38..d8f467e30fa6a 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -116,7 +116,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -131,6 +131,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 1978382d48571..515bc8c050f7b 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -190,7 +190,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -234,8 +234,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From 30983d1ad907744cac767a4f39c012a667db20c6 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 45826fcd19f38..d8f467e30fa6a 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -116,7 +116,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -131,6 +131,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 1978382d48571..515bc8c050f7b 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -190,7 +190,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -234,8 +234,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From 6e17ae5561d94e7da70fd1dee50b5c484f6ec34e Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index e5adcd33411c5..6d8f007136153 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -116,7 +116,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -131,6 +131,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 586b9721cdd32..7c0ffe170e196 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -170,7 +170,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -214,8 +214,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From 65cb831537a4c11c063a57a30afb3549b70a84ca Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 6cc65fabfcc99..d2704d5aa2616 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -103,7 +103,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -118,6 +118,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 91f303c9e3d3c..a6fda0cfeadd2 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -170,7 +170,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -214,8 +214,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/143081
>From 65cb831537a4c11c063a57a30afb3549b70a84ca Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 6cc65fabfcc99..d2704d5aa2616 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -103,7 +103,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -118,6 +118,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 91f303c9e3d3c..a6fda0cfeadd2 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -170,7 +170,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -214,8 +214,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
llvmbot wrote:
@llvm/pr-subscribers-llvm-ir
Author: Matt Arsenault (arsenm)
Changes
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
Full diff: https://github.com/llvm/llvm-project/pull/143081.diff
2 Files Affected:
- (modified) llvm/include/llvm/IR/RuntimeLibcalls.h (+7-1)
- (modified) llvm/lib/IR/RuntimeLibcalls.cpp (+2-3)
``diff
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 6cc65fabfcc99..d2704d5aa2616 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -103,7 +103,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -118,6 +118,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 91f303c9e3d3c..a6fda0cfeadd2 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -170,7 +170,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -214,8 +214,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
``
https://github.com/llvm/llvm-project/pull/143081
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/143081 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
arsenm wrote: > [!WARNING] > This pull request is not mergeable via GitHub because a downstack PR is > open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/143081?utm_source=stack-comment-downstack-mergeability-warning"; > >on Graphite. > https://graphite.dev/docs/merge-pull-requests";>Learn more * **#143081** https://app.graphite.dev/github/pr/llvm/llvm-project/143081?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/143081?utm_source=stack-comment-view-in-graphite"; target="_blank">(View in Graphite) * **#142905** https://app.graphite.dev/github/pr/llvm/llvm-project/142905?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/>: 1 other dependent PR ([#142912](https://github.com/llvm/llvm-project/pull/142912) https://app.graphite.dev/github/pr/llvm/llvm-project/142912?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/>) * **#142898** https://app.graphite.dev/github/pr/llvm/llvm-project/142898?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * `main` This stack of pull requests is managed by https://graphite.dev?utm-source=stack-comment";>Graphite. Learn more about https://stacking.dev/?utm_source=stack-comment";>stacking. https://github.com/llvm/llvm-project/pull/143081 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] RuntimeLibcalls: Cleanup sincos predicate functions (PR #143081)
https://github.com/arsenm created
https://github.com/llvm/llvm-project/pull/143081
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
>From ee79ca11029ca60e9b6062cde3d0f468c2d5a7b3 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Fri, 6 Jun 2025 15:15:53 +0900
Subject: [PATCH] RuntimeLibcalls: Cleanup sincos predicate functions
The darwinHasSinCos wasn't actually used for sincos, only the stret
variant. Rename this to reflect that, and introduce a new one for
enabling sincos.
---
llvm/include/llvm/IR/RuntimeLibcalls.h | 8 +++-
llvm/lib/IR/RuntimeLibcalls.cpp| 5 ++---
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 6cc65fabfcc99..d2704d5aa2616 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -103,7 +103,7 @@ struct RuntimeLibcallsInfo {
// opcode.
CmpInst::Predicate SoftFloatCompareLibcallPredicates[RTLIB::UNKNOWN_LIBCALL];
- static bool darwinHasSinCos(const Triple &TT) {
+ static bool darwinHasSinCosStret(const Triple &TT) {
assert(TT.isOSDarwin() && "should be called with darwin triple");
// Don't bother with 32 bit x86.
if (TT.getArch() == Triple::x86)
@@ -118,6 +118,12 @@ struct RuntimeLibcallsInfo {
return true;
}
+ /// Return true if the target has sincosf/sincos/sincosl functions
+ static bool hasSinCos(const Triple &TT) {
+return TT.isGNUEnvironment() || TT.isOSFuchsia() ||
+ (TT.isAndroid() && !TT.isAndroidVersionLT(9));
+ }
+
void initSoftFloatCmpLibcallPredicates();
/// Set default libcall names. If a target wants to opt-out of a libcall it
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 91f303c9e3d3c..a6fda0cfeadd2 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -170,7 +170,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
-if (darwinHasSinCos(TT)) {
+if (darwinHasSinCosStret(TT)) {
setLibcallName(RTLIB::SINCOS_STRET_F32, "__sincosf_stret");
setLibcallName(RTLIB::SINCOS_STRET_F64, "__sincos_stret");
if (TT.isWatchABI()) {
@@ -214,8 +214,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
setLibcallName(RTLIB::EXP10_F64, "__exp10");
}
- if (TT.isGNUEnvironment() || TT.isOSFuchsia() ||
- (TT.isAndroid() && !TT.isAndroidVersionLT(9))) {
+ if (hasSinCos(TT)) {
setLibcallName(RTLIB::SINCOS_F32, "sincosf");
setLibcallName(RTLIB::SINCOS_F64, "sincos");
setLibcallName(RTLIB::SINCOS_F80, "sincosl");
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
