Skip to content

Commit 6185ad0

Browse files
committed
[TargetLibraryInfo] Correctly handle sqrt*_finite
Other <math>_finite calls are marked as unavailable except on GNU/Linux; it looks like the sqrt set was just overlooked. Differential Revision: https://reviews.llvm.org/D110418
1 parent f8da95c commit 6185ad0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

llvm/lib/Analysis/TargetLibraryInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
568568
TLI.setUnavailable(LibFunc_sinh_finite);
569569
TLI.setUnavailable(LibFunc_sinhf_finite);
570570
TLI.setUnavailable(LibFunc_sinhl_finite);
571+
TLI.setUnavailable(LibFunc_sqrt_finite);
572+
TLI.setUnavailable(LibFunc_sqrtf_finite);
573+
TLI.setUnavailable(LibFunc_sqrtl_finite);
571574
}
572575

573576
if ((T.isOSLinux() && T.isGNUEnvironment()) ||

llvm/test/CodeGen/X86/sqrt-fastmath.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64 -mattr=+sse2 | FileCheck %s --check-prefix=CHECK --check-prefix=SSE
3-
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64 -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX1
4-
; RUN: llc < %s -mtriple=x86_64-- -mcpu=x86-64 -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX512
2+
; RUN: llc < %s -mtriple=x86_64--linux-gnu -mcpu=x86-64 -mattr=+sse2 | FileCheck %s --check-prefix=CHECK --check-prefix=SSE
3+
; RUN: llc < %s -mtriple=x86_64--linux-gnu -mcpu=x86-64 -mattr=+avx | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX1
4+
; RUN: llc < %s -mtriple=x86_64--linux-gnu -mcpu=x86-64 -mattr=+avx512f | FileCheck %s --check-prefix=CHECK --check-prefix=AVX --check-prefix=AVX512
55

66
declare double @__sqrt_finite(double)
77
declare float @__sqrtf_finite(float)

0 commit comments

Comments
 (0)