From 7b99b1d4f733ed5e1b206f0b392b0864e7a0d468 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Mon, 29 Jul 2024 20:23:18 +0100 Subject: [PATCH] [Darwin] Fix availability of exp10 for BridgeOS, DriverKit. (#100894) Same as https://github.com/llvm/llvm-project/pull/98542, but also mark exp10 available on BridgeOS and DriverKit. Note that BridgeOS currently is not included by isOSDarwin, but it probably should. PR: https://github.com/llvm/llvm-project/pull/100894 --- llvm/lib/IR/RuntimeLibcalls.cpp | 5 ++++ .../CodeGen/AArch64/exp10-libcall-names.ll | 24 +++++++++---------- llvm/test/CodeGen/X86/exp10-libcall-names.ll | 4 ++-- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/llvm/lib/IR/RuntimeLibcalls.cpp b/llvm/lib/IR/RuntimeLibcalls.cpp index 8ce0caadbafd18..d806f8093459ee 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 ea4f5811933479..6e603b7064f8f9 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 d0f2eac4e796cb..4f993cfe74a3b7 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.