-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Darwin] Fix availability of exp10 for BridgeOS, DriverKit. #100894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Same as llvm#98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should.
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-aarch64 Author: Florian Hahn (fhahn) ChangesSame as #98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should. Full diff: https://github.com/llvm/llvm-project/pull/100894.diff 3 Files Affected:
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 8ce0caadbafd1..d806f8093459e 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -155,6 +155,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
[[fallthrough]];
+ case Triple::DriverKit:
case Triple::TvOS:
case Triple::WatchOS:
case Triple::XROS:
@@ -164,6 +165,10 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
default:
break;
}
+ } else if (TT.getOS() == Triple::BridgeOS) {
+ // TODO: BridgeOS should be included in isOSDarwin.
+ setLibcallName(RTLIB::EXP10_F32, "__exp10f");
+ setLibcallName(RTLIB::EXP10_F64, "__exp10");
} else {
setLibcallName(RTLIB::FPEXT_F16_F32, "__gnu_h2f_ieee");
setLibcallName(RTLIB::FPROUND_F32_F16, "__gnu_f2h_ieee");
diff --git a/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll b/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll
index ea4f581193347..6e603b7064f8f 100644
--- a/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll
+++ b/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll
@@ -7,12 +7,12 @@
; RUN: llc -mtriple=aarch64-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=aarch64-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=aarch64-apple-xros1.0 < %s | FileCheck -check-prefix=APPLE %s
-; RUN: llc -mtriple=arm64-apple-driverkit < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=arm64-apple-driverkit1.0 < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=arm64-apple-driverkit24.0 < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=arm64-apple-bridgeos < %s | FileCheck -check-prefix=LINUX %s
-; RUN: llc -mtriple=arm64-apple-bridgeos1.0 < %s | FileCheck -check-prefix=LINUX %s
-; RUN: llc -mtriple=arm64-apple-bridgeos9.0 < %s | FileCheck -check-prefix=LINUX %s
+; RUN: llc -mtriple=arm64-apple-driverkit < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=arm64-apple-driverkit1.0 < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=arm64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=arm64-apple-bridgeos < %s | FileCheck -check-prefix=BRIDGEOS %s
+; RUN: llc -mtriple=arm64-apple-bridgeos1.0 < %s | FileCheck -check-prefix=BRIDGEOS %s
+; RUN: llc -mtriple=arm64-apple-bridgeos9.0 < %s | FileCheck -check-prefix=BRIDGEOS %s
; RUN: not llc -mtriple=aarch64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
; RUN: not llc -mtriple=aarch64-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
@@ -30,9 +30,9 @@ define float @test_exp10_f32(float %x) {
; APPLE: ; %bb.0:
; APPLE-NEXT: b ___exp10f
;
-; MISSED-LABEL: test_exp10_f32:
-; MISSED: ; %bb.0:
-; MISSED-NEXT: b _exp10f
+; BRIDGEOS-LABEL: test_exp10_f32:
+; BRIDGEOS: // %bb.0:
+; BRIDGEOS-NEXT: b __exp10f
;
%ret = call float @llvm.exp10.f32(float %x)
ret float %ret
@@ -47,9 +47,9 @@ define double @test_exp10_f64(double %x) {
; APPLE: ; %bb.0:
; APPLE-NEXT: b ___exp10
;
-; MISSED-LABEL: test_exp10_f64:
-; MISSED: ; %bb.0:
-; MISSED-NEXT: b _exp10
+; BRIDGEOS-LABEL: test_exp10_f64:
+; BRIDGEOS: // %bb.0:
+; BRIDGEOS-NEXT: b __exp10
;
%ret = call double @llvm.exp10.f64(double %x)
ret double %ret
diff --git a/llvm/test/CodeGen/X86/exp10-libcall-names.ll b/llvm/test/CodeGen/X86/exp10-libcall-names.ll
index d0f2eac4e796c..4f993cfe74a3b 100644
--- a/llvm/test/CodeGen/X86/exp10-libcall-names.ll
+++ b/llvm/test/CodeGen/X86/exp10-libcall-names.ll
@@ -8,8 +8,8 @@
; RUN: llc -mtriple=x86_64-apple-ios8.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=x86_64-apple-tvos8.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=x86_64-apple-xros8.0 < %s | FileCheck -check-prefix=APPLE %s
-; RUN: llc -mtriple=x86_64-apple-driverkit < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=MISSED %s
+; RUN: llc -mtriple=x86_64-apple-driverkit < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: not llc -mtriple=x86_64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.
|
@llvm/pr-subscribers-backend-x86 Author: Florian Hahn (fhahn) ChangesSame as #98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should. Full diff: https://github.com/llvm/llvm-project/pull/100894.diff 3 Files Affected:
diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp
index 8ce0caadbafd1..d806f8093459e 100644
--- a/llvm/lib/IR/RuntimeLibcalls.cpp
+++ b/llvm/lib/IR/RuntimeLibcalls.cpp
@@ -155,6 +155,7 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
break;
}
[[fallthrough]];
+ case Triple::DriverKit:
case Triple::TvOS:
case Triple::WatchOS:
case Triple::XROS:
@@ -164,6 +165,10 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT) {
default:
break;
}
+ } else if (TT.getOS() == Triple::BridgeOS) {
+ // TODO: BridgeOS should be included in isOSDarwin.
+ setLibcallName(RTLIB::EXP10_F32, "__exp10f");
+ setLibcallName(RTLIB::EXP10_F64, "__exp10");
} else {
setLibcallName(RTLIB::FPEXT_F16_F32, "__gnu_h2f_ieee");
setLibcallName(RTLIB::FPROUND_F32_F16, "__gnu_f2h_ieee");
diff --git a/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll b/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll
index ea4f581193347..6e603b7064f8f 100644
--- a/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll
+++ b/llvm/test/CodeGen/AArch64/exp10-libcall-names.ll
@@ -7,12 +7,12 @@
; RUN: llc -mtriple=aarch64-apple-tvos6.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=aarch64-apple-xros6.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=aarch64-apple-xros1.0 < %s | FileCheck -check-prefix=APPLE %s
-; RUN: llc -mtriple=arm64-apple-driverkit < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=arm64-apple-driverkit1.0 < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=arm64-apple-driverkit24.0 < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=arm64-apple-bridgeos < %s | FileCheck -check-prefix=LINUX %s
-; RUN: llc -mtriple=arm64-apple-bridgeos1.0 < %s | FileCheck -check-prefix=LINUX %s
-; RUN: llc -mtriple=arm64-apple-bridgeos9.0 < %s | FileCheck -check-prefix=LINUX %s
+; RUN: llc -mtriple=arm64-apple-driverkit < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=arm64-apple-driverkit1.0 < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=arm64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=arm64-apple-bridgeos < %s | FileCheck -check-prefix=BRIDGEOS %s
+; RUN: llc -mtriple=arm64-apple-bridgeos1.0 < %s | FileCheck -check-prefix=BRIDGEOS %s
+; RUN: llc -mtriple=arm64-apple-bridgeos9.0 < %s | FileCheck -check-prefix=BRIDGEOS %s
; RUN: not llc -mtriple=aarch64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
; RUN: not llc -mtriple=aarch64-apple-ios6.0 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
@@ -30,9 +30,9 @@ define float @test_exp10_f32(float %x) {
; APPLE: ; %bb.0:
; APPLE-NEXT: b ___exp10f
;
-; MISSED-LABEL: test_exp10_f32:
-; MISSED: ; %bb.0:
-; MISSED-NEXT: b _exp10f
+; BRIDGEOS-LABEL: test_exp10_f32:
+; BRIDGEOS: // %bb.0:
+; BRIDGEOS-NEXT: b __exp10f
;
%ret = call float @llvm.exp10.f32(float %x)
ret float %ret
@@ -47,9 +47,9 @@ define double @test_exp10_f64(double %x) {
; APPLE: ; %bb.0:
; APPLE-NEXT: b ___exp10
;
-; MISSED-LABEL: test_exp10_f64:
-; MISSED: ; %bb.0:
-; MISSED-NEXT: b _exp10
+; BRIDGEOS-LABEL: test_exp10_f64:
+; BRIDGEOS: // %bb.0:
+; BRIDGEOS-NEXT: b __exp10
;
%ret = call double @llvm.exp10.f64(double %x)
ret double %ret
diff --git a/llvm/test/CodeGen/X86/exp10-libcall-names.ll b/llvm/test/CodeGen/X86/exp10-libcall-names.ll
index d0f2eac4e796c..4f993cfe74a3b 100644
--- a/llvm/test/CodeGen/X86/exp10-libcall-names.ll
+++ b/llvm/test/CodeGen/X86/exp10-libcall-names.ll
@@ -8,8 +8,8 @@
; RUN: llc -mtriple=x86_64-apple-ios8.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=x86_64-apple-tvos8.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: llc -mtriple=x86_64-apple-xros8.0 < %s | FileCheck -check-prefix=APPLE %s
-; RUN: llc -mtriple=x86_64-apple-driverkit < %s | FileCheck -check-prefix=MISSED %s
-; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=MISSED %s
+; RUN: llc -mtriple=x86_64-apple-driverkit < %s | FileCheck -check-prefix=APPLE %s
+; RUN: llc -mtriple=x86_64-apple-driverkit24.0 < %s | FileCheck -check-prefix=APPLE %s
; RUN: not llc -mtriple=x86_64-apple-macos10.8 -filetype=null %s 2>&1 | FileCheck -check-prefix=ERR %s
; Check exp10/exp10f is emitted as __exp10/__exp10f on assorted systems.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
) Same as llvm#98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should. PR: llvm#100894 (cherry-picked from 7b99b1d)
* [Darwin] Add exp10(f) tests for BridgeOS & Driverkit. (chery-picked from e83ba1e) * [Darwin] Fix availability of exp10 for BridgeOS, DriverKit. (llvm#100894) Same as llvm#98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should. PR: llvm#100894 (cherry-picked from 7b99b1d)
Same as #98542, but also mark exp10 available on BridgeOS and DriverKit.
Note that BridgeOS currently is not included by isOSDarwin, but it probably should.