[llvm] [LLVM] Add constant folding for llrint, llrintf, llrintl (PR #154799)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 10 09:13:27 PST 2025
https://github.com/pratheekhassan21 updated https://github.com/llvm/llvm-project/pull/154799
>From 6b5a018e6805418548cc5af17740ddb7fed7c04b Mon Sep 17 00:00:00 2001
From: Pratheek Gowda BS <pratheekgowdabs at example.com>
Date: Sun, 24 Aug 2025 16:07:03 +0530
Subject: [PATCH 1/5] errors were fixed
---
.../llvm/Transforms/Utils/SimplifyLibCalls.h | 1 +
llvm/lib/Analysis/TargetLibraryInfo.cpp | 2 +
llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 7 ++
.../lib/Transforms/Utils/SimplifyLibCalls.cpp | 22 ++++
.../Transforms/InferFunctionAttrs/annotate.ll | 12 ++-
.../Transforms/InstCombine/llrint_fold.ll | 87 +++++++++++++++
.../Transforms/InstCombine/llrintf_fold.ll | 102 ++++++++++++++++++
.../Transforms/InstCombine/llrintl_fp80.ll | 65 +++++++++++
.../tools/llvm-tli-checker/ps4-tli-check.yaml | 12 +++
.../Analysis/TargetLibraryInfoTest.cpp | 3 +
10 files changed, 312 insertions(+), 1 deletion(-)
create mode 100644 llvm/test/Transforms/InstCombine/llrint_fold.ll
create mode 100644 llvm/test/Transforms/InstCombine/llrintf_fold.ll
create mode 100644 llvm/test/Transforms/InstCombine/llrintl_fp80.ll
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
index 64d2512308935..4433623cf6a31 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
@@ -209,6 +209,7 @@ class LibCallSimplifier {
Value *optimizeLog(CallInst *CI, IRBuilderBase &B);
Value *optimizeSqrt(CallInst *CI, IRBuilderBase &B);
Value *optimizeFMod(CallInst *CI, IRBuilderBase &B);
+ Value *optimizellrint(CallInst *CI,IRBuilderBase &B);
Value *mergeSqrtToExp(CallInst *CI, IRBuilderBase &B);
Value *optimizeSinCosPi(CallInst *CI, bool IsSin, IRBuilderBase &B);
Value *optimizeTrigInversionPairs(CallInst *CI, IRBuilderBase &B);
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp
index 51b1f5874bcb6..12074632e662c 100644
--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -255,6 +255,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T,
TLI.setUnavailable(LibFunc_floorf);
TLI.setUnavailable(LibFunc_fmodf);
TLI.setUnavailable(LibFunc_hypotf);
+ TLI.setAvailable(LibFunc_llrintf);
TLI.setUnavailable(LibFunc_log10f);
TLI.setUnavailable(LibFunc_logf);
TLI.setUnavailable(LibFunc_modff);
@@ -288,6 +289,7 @@ static void initializeLibCalls(TargetLibraryInfoImpl &TLI, const Triple &T,
TLI.setUnavailable(LibFunc_frexpl);
TLI.setUnavailable(LibFunc_hypotl);
TLI.setUnavailable(LibFunc_ldexpl);
+ TLI.setUnavailable(LibFunc_llrintl);
TLI.setUnavailable(LibFunc_log10l);
TLI.setUnavailable(LibFunc_logl);
TLI.setUnavailable(LibFunc_modfl);
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index a245b9405cfb7..8e830add51604 100644
--- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -1383,6 +1383,13 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
Changed |= setDoesNotFreeMemory(F);
Changed |= setWillReturn(F);
break;
+ case LibFunc_llrintf:
+ case LibFunc_llrintl:
+ case LibFunc_llrint:
+ Changed|=setDoesNotThrow(F);
+ Changed|=setDoesNotAccessMemory(F);
+ Changed|=setWillReturn(F);
+ break;
case LibFunc_sincos:
case LibFunc_sincosf:
case LibFunc_sincosl:
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index c3537f544c432..441fca83face7 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -3188,6 +3188,28 @@ Value *LibCallSimplifier::optimizeRemquo(CallInst *CI, IRBuilderBase &B) {
return ConstantFP::get(CI->getType(), Rem);
}
+Value *LibCallSimplifier::optimizellrint(CallInst *CI,IRBuilderBase &B){
+ const APFloat *X;
+ if(!match(CI->getOperand(0),m_APFloat(X))){
+ return nullptr;
+ }
+ Type *type=CI->getType();
+
+ unsigned width=type->getIntegerBitWidth();
+
+ APSInt Result(width,false);
+ bool Isexact;
+
+ APFloat::opStatus Status=X->convertToInteger(Result,APFloat::rmNearestTiesToEven,&Isexact);
+
+ if(Status==APFloat::opOK || Status==APFloat::opInexact){
+ return ConstantInt::get(type,Result);
+ }
+
+ return nullptr;
+
+}
+
/// Constant folds fdim
Value *LibCallSimplifier::optimizeFdim(CallInst *CI, IRBuilderBase &B) {
// Cannot perform the fold unless the call has attribute memory(none)
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index 71bc369b062fb..bb075b017f270 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -679,7 +679,16 @@ declare i32 @ilogbf(float)
; CHECK: declare i32 @ilogbl(x86_fp80) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
declare i32 @ilogbl(x86_fp80)
-; CHECK: declare double @logb(double) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK: declare i64 @llrint(double) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare i64 @llrint(double)
+
+; CHECK: declare i64 @llrintf(float) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare i64 @llrintf(float)
+
+; CHECK: declare i64 @llrintl(x86_fp80) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
+declare i64 @llrintl(x86_fp80)
+
+; CHECK: declare double @logb(double) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN:#[0-9]+]]
declare double @logb(double)
; CHECK: declare float @logbf(float) [[ERRNOMEMONLY_NOFREE_NOUNWIND_WILLRETURN]]
@@ -1241,6 +1250,7 @@ declare void @memset_pattern16(ptr, ptr, i64)
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(read) }
; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY]] = { nofree nounwind memory(read) }
+; CHECK-DAG: attributes [[MATH_NOACCESS]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_FREE_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
diff --git a/llvm/test/Transforms/InstCombine/llrint_fold.ll b/llvm/test/Transforms/InstCombine/llrint_fold.ll
new file mode 100644
index 0000000000000..1e8b71d60f495
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/llrint_fold.ll
@@ -0,0 +1,87 @@
+; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
+
+
+declare i64 @llrint(double)
+
+; Positive number test
+; CHECK-LABEL: define i64 @test_llrint_pos()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 4
+define i64 @test_llrint_pos() {
+entry:
+ %val = call i64 @llrint(double 3.5)
+ ret i64 %val
+}
+
+; Negative number test
+; CHECK-LABEL: define i64 @test_llrint_neg()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 -2
+define i64 @test_llrint_neg() {
+entry:
+ %val = call i64 @llrint(double -2.5)
+ ret i64 %val
+}
+
+; Zero test
+; CHECK-LABEL: define i64 @test_llrint_zero()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 0
+define i64 @test_llrint_zero() {
+entry:
+ %val = call i64 @llrint(double 0.0)
+ ret i64 %val
+}
+
+; Large value test
+; CHECK-LABEL: define i64 @test_llrint_large()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 1000000
+define i64 @test_llrint_large() {
+entry:
+ %val = call i64 @llrint(double 1.0e6)
+ ret i64 %val
+}
+
+; Rounding test (check ties-to-even)
+; CHECK-LABEL: define i64 @test_llrint_round_even()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 2
+define i64 @test_llrint_round_even() {
+entry:
+ %val = call i64 @llrint(double 2.5)
+ ret i64 %val
+}
+
+; NaN test
+; CHECK-LABEL: define i64 @test_llrint_nan()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrint(double 0x7FF8000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrint_nan() {
+entry:
+ %val = call i64 @llrint(double 0x7FF8000000000000) ; NaN
+ ret i64 %val
+}
+
+; +Inf test
+; CHECK-LABEL: define i64 @test_llrint_posinf()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrint(double 0x7FF0000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrint_posinf() {
+entry:
+ %val = call i64 @llrint(double 0x7FF0000000000000) ; +Inf
+ ret i64 %val
+}
+
+; -Inf test
+; CHECK-LABEL: define i64 @test_llrint_neginf()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrint(double 0xFFF0000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrint_neginf() {
+entry:
+ %val = call i64 @llrint(double 0xFFF0000000000000) ; -Inf
+ ret i64 %val
+}
\ No newline at end of file
diff --git a/llvm/test/Transforms/InstCombine/llrintf_fold.ll b/llvm/test/Transforms/InstCombine/llrintf_fold.ll
new file mode 100644
index 0000000000000..e611f666fd646
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/llrintf_fold.ll
@@ -0,0 +1,102 @@
+; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
+
+declare i64 @llrintf(float)
+
+; Positive number test
+; CHECK-LABEL: define i64 @test_llrintf_pos()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 4
+define i64 @test_llrintf_pos() {
+entry:
+ %val = call i64 @llrintf(float 3.5)
+ ret i64 %val
+}
+
+; Negative number test
+; CHECK-LABEL: define i64 @test_llrintf_neg()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 -2
+define i64 @test_llrintf_neg() {
+entry:
+ %val = call i64 @llrintf(float -2.5)
+ ret i64 %val
+}
+
+; Zero test
+; CHECK-LABEL: define i64 @test_llrintf_zero()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 0
+define i64 @test_llrintf_zero() {
+entry:
+ %val = call i64 @llrintf(float 0.0)
+ ret i64 %val
+}
+ 65 changes: 65 additions & 0 deletions65
+llvm/test/Transforms/InstCombine/llrintl_fp80.ll
+Original file line number Diff line number Diff line change
+@@ -0,0 +1,65 @@
+; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
+declare i64 @llrintl(x86_fp80)
+
+; Positive number
+; CHECK-LABEL: define i64 @test_llrintl_pos()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 4
+define i64 @test_llrintl_pos() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK4000E000000000000000)
+ ret i64 %val
+}
+
+; Negative number
+; CHECK-LABEL: define i64 @test_llrintl_neg()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 -2
+define i64 @test_llrintl_neg() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xKC000A000000000000000)
+ ret i64 %val
+}
+
+; Zero
+; CHECK-LABEL: define i64 @test_llrintl_zero()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 0
+define i64 @test_llrintl_zero() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK00000000000000000000)
+ ret i64 %val
+}
+
+; NaN
+; CHECK-LABEL: define i64 @test_llrintl_nan()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrintl_nan() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
+ ret i64 %val
+}
+
+; +Inf
+; CHECK-LABEL: define i64 @test_llrintl_posinf()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrintl_posinf() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
+ ret i64 %val
+}
+
+; -Inf
+; CHECK-LABEL: define i64 @test_llrintl_neginf()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrintl_neginf() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
+ ret i64 %val
+}
\ No newline at end of file
diff --git a/llvm/test/Transforms/InstCombine/llrintl_fp80.ll b/llvm/test/Transforms/InstCombine/llrintl_fp80.ll
new file mode 100644
index 0000000000000..04d54d95163ef
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/llrintl_fp80.ll
@@ -0,0 +1,65 @@
+; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
+declare i64 @llrintl(x86_fp80)
+
+; Positive number
+; CHECK-LABEL: define i64 @test_llrintl_pos()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 4
+define i64 @test_llrintl_pos() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK4000E000000000000000)
+ ret i64 %val
+}
+
+; Negative number
+; CHECK-LABEL: define i64 @test_llrintl_neg()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 -2
+define i64 @test_llrintl_neg() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xKC000A000000000000000)
+ ret i64 %val
+}
+
+; Zero
+; CHECK-LABEL: define i64 @test_llrintl_zero()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: ret i64 0
+define i64 @test_llrintl_zero() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK00000000000000000000)
+ ret i64 %val
+}
+
+; NaN
+; CHECK-LABEL: define i64 @test_llrintl_nan()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrintl_nan() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
+ ret i64 %val
+}
+
+; +Inf
+; CHECK-LABEL: define i64 @test_llrintl_posinf()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrintl_posinf() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
+ ret i64 %val
+}
+
+; -Inf
+; CHECK-LABEL: define i64 @test_llrintl_neginf()
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
+; CHECK-NEXT: ret i64 %val
+define i64 @test_llrintl_neginf() {
+entry:
+ %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
+ ret i64 %val
+}
\ No newline at end of file
diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
index ff2c9ae00bdb9..e4f3827242944 100644
--- a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
+++ b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
@@ -690,6 +690,18 @@ DynamicSymbols:
Type: STT_FUNC
Section: .text
Binding: STB_GLOBAL
+ - Name: llrint
+ Type: STT_FUNC
+ Section: .text
+ Binding: STB_GLOBAL
+ - Name: llrintf
+ Type: STT_FUNC
+ Section: .text
+ Binding: STB_GLOBAL
+ - Name: llrintl
+ Type: STT_FUNC
+ Section: .text
+ Binding: STB_GLOBAL
- Name: logb
Type: STT_FUNC
Section: .text
diff --git a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
index 3029f10b1bb29..1388a0bdf9521 100644
--- a/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
+++ b/llvm/unittests/Analysis/TargetLibraryInfoTest.cpp
@@ -258,6 +258,9 @@ TEST_F(TargetLibraryInfoTest, ValidProto) {
"declare double @ldexp(double, i32)\n"
"declare float @ldexpf(float, i32)\n"
"declare x86_fp80 @ldexpl(x86_fp80, i32)\n"
+ "declare i64 @llrint(double)\n"
+ "declare i64 @llrintf(float)\n"
+ "declare i64 @llrintl(x86_fp80)\n"
"declare i64 @llabs(i64)\n"
"declare double @log(double)\n"
"declare double @log10(double)\n"
>From a143fd450f1df1ca2827ff26c21b2d2ada36f5ec Mon Sep 17 00:00:00 2001
From: Pratheek Gowda BS <pratheekgowdabs at example.com>
Date: Mon, 8 Dec 2025 14:28:56 +0530
Subject: [PATCH 2/5] logic moves to constantfolding.cpp
---
.github/workflows/bazel-checks.yml | 33 +----
.../include/llvm/Analysis/TargetLibraryInfo.h | 1 +
.../llvm/Analysis/TargetLibraryInfo.td | 9 ++
.../llvm/Transforms/Utils/SimplifyLibCalls.h | 1 -
llvm/lib/Analysis/ConstantFolding.cpp | 30 ++++-
llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 10 +-
.../lib/Transforms/Utils/SimplifyLibCalls.cpp | 24 +---
.../Transforms/InferFunctionAttrs/annotate.ll | 1 -
.../Transforms/InstCombine/llrint_fold.ll | 117 ++++++------------
.../Transforms/InstCombine/llrintf_fold.ll | 102 ---------------
.../Transforms/InstCombine/llrintl_fp80.ll | 65 ----------
11 files changed, 82 insertions(+), 311 deletions(-)
delete mode 100644 llvm/test/Transforms/InstCombine/llrintf_fold.ll
delete mode 100644 llvm/test/Transforms/InstCombine/llrintl_fp80.ll
diff --git a/.github/workflows/bazel-checks.yml b/.github/workflows/bazel-checks.yml
index aa318569532ec..65d51649dd9e7 100644
--- a/.github/workflows/bazel-checks.yml
+++ b/.github/workflows/bazel-checks.yml
@@ -22,40 +22,11 @@ jobs:
if: github.repository == 'llvm/llvm-project'
steps:
- name: Fetch LLVM sources
- uses: actions/checkout at 1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
+ uses: actions/checkout at 08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup Buildifier
run: |
- sudo curl -L https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64 -o /usr/bin/buildifier --fail
+ sudo curl -L https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64 -o /usr/bin/buildifier
sudo chmod +x /usr/bin/buildifier
- name: Run Buildifier
run: |
buildifier --mode=check $(find ./utils/bazel -name *BUILD*)
-
- bazel-build:
- name: "Bazel Build/Test"
- # Only run on US Central workers so we only have to keep one cache warm as
- # the cache buckets are per cluster.
- runs-on:
- group: llvm-premerge-cluster-us-central
- labels: llvm-premerge-linux-runners
- if: github.repository == 'llvm/llvm-project'
- steps:
- - name: Fetch LLVM sources
- uses: actions/checkout at 1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- # TODO(boomanaiden154): We should use a purpose built container for this. Move
- # over when we have fixed the issues with using custom containers with Github
- # ARC in GKE.
- - name: Setup System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libmpfr-dev libpfm4-dev m4 libedit-dev
- sudo curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-amd64.deb --fail > /tmp/bazelisk.deb
- sudo apt-get install -y /tmp/bazelisk.deb
- rm /tmp/bazelisk.deb
- - name: Build/Test
- working-directory: utils/bazel
- run: |
- bazelisk test --config=ci --sandbox_base="" \
- --remote_cache=https://storage.googleapis.com/$CACHE_GCS_BUCKET-bazel \
- --google_default_credentials \
- @llvm-project//... //...
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
index 0f98af69f12c6..c90a3bb14624c 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
@@ -411,6 +411,7 @@ class TargetLibraryInfo {
case LibFunc_fmax: case LibFunc_fmaxf: case LibFunc_fmaxl:
case LibFunc_fmin: case LibFunc_fminf: case LibFunc_fminl:
case LibFunc_ldexp: case LibFunc_ldexpf: case LibFunc_ldexpl:
+ case LibFunc_llrint: case LibFunc_llrintf: case LibFunc_llrintl:
case LibFunc_log2: case LibFunc_log2f: case LibFunc_log2l:
case LibFunc_memcmp: case LibFunc_bcmp: case LibFunc_strcmp:
case LibFunc_memcpy: case LibFunc_memset: case LibFunc_memmove:
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.td b/llvm/include/llvm/Analysis/TargetLibraryInfo.td
index 10b43ad2466fc..4e19bb11429f6 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.td
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.td
@@ -1141,6 +1141,15 @@ def ilogbf : TargetLibCall<"ilogbf", Int, [Flt]>;
/// int ilogbl(long double x);
def ilogbl : TargetLibCall<"ilogbl", Int, [LDbl]>;
+/// long long llrint(double x);
+def llrint : TargetLibCall<"llrint",LLong,[Dbl]>;
+
+///long long llrintf( float x);
+def llrintf : TargetLibCall<"llrintf",LLong,[Flt]>;
+
+///long long llrintl(long double x);
+def llrintl : TargetLibCall<"llrintl",LLong,[LDbl]>;
+
/// double logb(double x);
def logb : TargetLibCall<"logb", Dbl, [Dbl]>;
diff --git a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
index 4433623cf6a31..64d2512308935 100644
--- a/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
+++ b/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
@@ -209,7 +209,6 @@ class LibCallSimplifier {
Value *optimizeLog(CallInst *CI, IRBuilderBase &B);
Value *optimizeSqrt(CallInst *CI, IRBuilderBase &B);
Value *optimizeFMod(CallInst *CI, IRBuilderBase &B);
- Value *optimizellrint(CallInst *CI,IRBuilderBase &B);
Value *mergeSqrtToExp(CallInst *CI, IRBuilderBase &B);
Value *optimizeSinCosPi(CallInst *CI, bool IsSin, IRBuilderBase &B);
Value *optimizeTrigInversionPairs(CallInst *CI, IRBuilderBase &B);
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index b39b32042dd2f..25f9af733fd78 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -1943,6 +1943,7 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
// environment, they can be folded in any case.
case Intrinsic::ceil:
case Intrinsic::floor:
+ case Intrinsic::llrint:
case Intrinsic::round:
case Intrinsic::roundeven:
case Intrinsic::trunc:
@@ -2007,7 +2008,8 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
return Name == "log" || Name == "logf" || Name == "logl" ||
Name == "log2" || Name == "log2f" || Name == "log10" ||
Name == "log10f" || Name == "logb" || Name == "logbf" ||
- Name == "log1p" || Name == "log1pf";
+ Name == "log1p" || Name == "log1pf" || Name=="llrint" ||
+ Name=="llrintf";
case 'n':
return Name == "nearbyint" || Name == "nearbyintf";
case 'p':
@@ -2519,8 +2521,24 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
// Use internal versions of these intrinsics.
- if (IntrinsicID == Intrinsic::nearbyint || IntrinsicID == Intrinsic::rint ||
- IntrinsicID == Intrinsic::roundeven) {
+
+ if (IntrinsicID == Intrinsic::llrint) {
+ unsigned Width = Ty->getIntegerBitWidth();
+ APSInt Result(Width, /*isUnsigned=*/false);
+ bool IsExact = false;
+ APFloat Tmp = U;
+ APFloat::opStatus Status = Tmp.convertToInteger(
+ Result, APFloat::rmNearestTiesToEven, &IsExact);
+
+ // Allowed: opOK or opInexact
+ // Disallowed: opInvalidOp (overflow)
+ if (Status == APFloat::opOK || Status == APFloat::opInexact)
+ return ConstantInt::get(Ty, Result);
+
+ return nullptr;
+ }
+
+ if (IntrinsicID == Intrinsic::nearbyint || IntrinsicID == Intrinsic::rint) {
U.roundToIntegral(APFloat::rmNearestTiesToEven);
return ConstantFP::get(Ty->getContext(), U);
}
@@ -2940,6 +2958,12 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
return ConstantFP::get(Ty->getContext(), U);
}
break;
+ case LibFunc_llrint:
+ case LibFunc_llrintf:
+ if (TLI->has(Func)) {
+ return ConstantFP::get(Ty->getContext(), U);
+ }
+ break;
case LibFunc_log:
case LibFunc_logf:
case LibFunc_log_finite:
diff --git a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
index 8e830add51604..16f89126d8dd8 100644
--- a/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/BuildLibCalls.cpp
@@ -1361,6 +1361,9 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
case LibFunc_fminimum_numl:
case LibFunc_labs:
case LibFunc_llabs:
+ case LibFunc_llrintf:
+ case LibFunc_llrintl:
+ case LibFunc_llrint:
case LibFunc_nearbyint:
case LibFunc_nearbyintf:
case LibFunc_nearbyintl:
@@ -1383,13 +1386,6 @@ bool llvm::inferNonMandatoryLibFuncAttrs(Function &F,
Changed |= setDoesNotFreeMemory(F);
Changed |= setWillReturn(F);
break;
- case LibFunc_llrintf:
- case LibFunc_llrintl:
- case LibFunc_llrint:
- Changed|=setDoesNotThrow(F);
- Changed|=setDoesNotAccessMemory(F);
- Changed|=setWillReturn(F);
- break;
case LibFunc_sincos:
case LibFunc_sincosf:
case LibFunc_sincosl:
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 441fca83face7..b6891ab294787 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -3188,28 +3188,6 @@ Value *LibCallSimplifier::optimizeRemquo(CallInst *CI, IRBuilderBase &B) {
return ConstantFP::get(CI->getType(), Rem);
}
-Value *LibCallSimplifier::optimizellrint(CallInst *CI,IRBuilderBase &B){
- const APFloat *X;
- if(!match(CI->getOperand(0),m_APFloat(X))){
- return nullptr;
- }
- Type *type=CI->getType();
-
- unsigned width=type->getIntegerBitWidth();
-
- APSInt Result(width,false);
- bool Isexact;
-
- APFloat::opStatus Status=X->convertToInteger(Result,APFloat::rmNearestTiesToEven,&Isexact);
-
- if(Status==APFloat::opOK || Status==APFloat::opInexact){
- return ConstantInt::get(type,Result);
- }
-
- return nullptr;
-
-}
-
/// Constant folds fdim
Value *LibCallSimplifier::optimizeFdim(CallInst *CI, IRBuilderBase &B) {
// Cannot perform the fold unless the call has attribute memory(none)
@@ -4130,6 +4108,8 @@ Value *LibCallSimplifier::optimizeFloatingPointLibCall(CallInst *CI,
return replaceUnaryCall(CI, Builder, Intrinsic::ceil);
case LibFunc_floor:
return replaceUnaryCall(CI, Builder, Intrinsic::floor);
+ case LibFunc_llrint:
+ return replaceUnaryCall(CI, Builder, Intrinsic::llrint);
case LibFunc_round:
return replaceUnaryCall(CI, Builder, Intrinsic::round);
case LibFunc_roundeven:
diff --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index bb075b017f270..2eec18dec8a18 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -1250,7 +1250,6 @@ declare void @memset_pattern16(ptr, ptr, i64)
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(read) }
; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY]] = { nofree nounwind memory(read) }
-; CHECK-DAG: attributes [[MATH_NOACCESS]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN_ALLOCKIND_FREE_FAMILY_MALLOC]] = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_ALLOCSIZE0_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN_ALLOCKIND_ALLOCUNINIT_FAMILY_MALLOC]] = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
diff --git a/llvm/test/Transforms/InstCombine/llrint_fold.ll b/llvm/test/Transforms/InstCombine/llrint_fold.ll
index 1e8b71d60f495..345530431a494 100644
--- a/llvm/test/Transforms/InstCombine/llrint_fold.ll
+++ b/llvm/test/Transforms/InstCombine/llrint_fold.ll
@@ -1,87 +1,46 @@
-; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
-
-
-declare i64 @llrint(double)
-
-; Positive number test
-; CHECK-LABEL: define i64 @test_llrint_pos()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 4
-define i64 @test_llrint_pos() {
-entry:
- %val = call i64 @llrint(double 3.5)
- ret i64 %val
-}
-
-; Negative number test
-; CHECK-LABEL: define i64 @test_llrint_neg()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 -2
-define i64 @test_llrint_neg() {
-entry:
- %val = call i64 @llrint(double -2.5)
- ret i64 %val
-}
-
-; Zero test
-; CHECK-LABEL: define i64 @test_llrint_zero()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 0
-define i64 @test_llrint_zero() {
-entry:
- %val = call i64 @llrint(double 0.0)
- ret i64 %val
-}
-
-; Large value test
-; CHECK-LABEL: define i64 @test_llrint_large()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 1000000
-define i64 @test_llrint_large() {
-entry:
- %val = call i64 @llrint(double 1.0e6)
- ret i64 %val
+; RUN: opt -S -passes=instcombine %s | FileCheck %s
+
+; ============================================================
+; Test constant folding of overloaded @llvm.llrint intrinsic
+; ============================================================
+
+; LLVM intrinsic declarations (typed overloads)
+declare i64 @llvm.llrint.f32(float)
+declare i64 @llvm.llrint.f64(double)
+declare i64 @llvm.llrint.f80(x86_fp80)
+declare i64 @llvm.llrint.f128(fp128)
+
+; ============================================================
+; float overload
+; ============================================================
+define i64 @test_f32_pos() {
+; CHECK-LABEL: @test_f32_pos(
+; CHECK-NEXT: ret i64 4
+ %v = call i64 @llvm.llrint.f32(float 3.5)
+ ret i64 %v
}
-; Rounding test (check ties-to-even)
-; CHECK-LABEL: define i64 @test_llrint_round_even()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 2
-define i64 @test_llrint_round_even() {
-entry:
- %val = call i64 @llrint(double 2.5)
- ret i64 %val
+define i64 @test_f32_neg() {
+; CHECK-LABEL: @test_f32_neg(
+; CHECK-NEXT: ret i64 -2
+ %v = call i64 @llvm.llrint.f32(float -2.5)
+ ret i64 %v
}
-; NaN test
-; CHECK-LABEL: define i64 @test_llrint_nan()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrint(double 0x7FF8000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrint_nan() {
-entry:
- %val = call i64 @llrint(double 0x7FF8000000000000) ; NaN
- ret i64 %val
+; ============================================================
+; double overload
+; ============================================================
+define i64 @test_f64_pos() {
+; CHECK-LABEL: @test_f64_pos(
+; CHECK-NEXT: ret i64 4
+ %v = call i64 @llvm.llrint.f64(double 3.5)
+ ret i64 %v
}
-; +Inf test
-; CHECK-LABEL: define i64 @test_llrint_posinf()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrint(double 0x7FF0000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrint_posinf() {
-entry:
- %val = call i64 @llrint(double 0x7FF0000000000000) ; +Inf
- ret i64 %val
+define i64 @test_f64_neg() {
+; CHECK-LABEL: @test_f64_neg(
+; CHECK-NEXT: ret i64 -2
+ %v = call i64 @llvm.llrint.f64(double -2.5)
+ ret i64 %v
}
-; -Inf test
-; CHECK-LABEL: define i64 @test_llrint_neginf()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrint(double 0xFFF0000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrint_neginf() {
-entry:
- %val = call i64 @llrint(double 0xFFF0000000000000) ; -Inf
- ret i64 %val
-}
\ No newline at end of file
diff --git a/llvm/test/Transforms/InstCombine/llrintf_fold.ll b/llvm/test/Transforms/InstCombine/llrintf_fold.ll
deleted file mode 100644
index e611f666fd646..0000000000000
--- a/llvm/test/Transforms/InstCombine/llrintf_fold.ll
+++ /dev/null
@@ -1,102 +0,0 @@
-; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
-
-declare i64 @llrintf(float)
-
-; Positive number test
-; CHECK-LABEL: define i64 @test_llrintf_pos()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 4
-define i64 @test_llrintf_pos() {
-entry:
- %val = call i64 @llrintf(float 3.5)
- ret i64 %val
-}
-
-; Negative number test
-; CHECK-LABEL: define i64 @test_llrintf_neg()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 -2
-define i64 @test_llrintf_neg() {
-entry:
- %val = call i64 @llrintf(float -2.5)
- ret i64 %val
-}
-
-; Zero test
-; CHECK-LABEL: define i64 @test_llrintf_zero()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 0
-define i64 @test_llrintf_zero() {
-entry:
- %val = call i64 @llrintf(float 0.0)
- ret i64 %val
-}
- 65 changes: 65 additions & 0 deletions65
-llvm/test/Transforms/InstCombine/llrintl_fp80.ll
-Original file line number Diff line number Diff line change
-@@ -0,0 +1,65 @@
-; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
-declare i64 @llrintl(x86_fp80)
-
-; Positive number
-; CHECK-LABEL: define i64 @test_llrintl_pos()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 4
-define i64 @test_llrintl_pos() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK4000E000000000000000)
- ret i64 %val
-}
-
-; Negative number
-; CHECK-LABEL: define i64 @test_llrintl_neg()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 -2
-define i64 @test_llrintl_neg() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xKC000A000000000000000)
- ret i64 %val
-}
-
-; Zero
-; CHECK-LABEL: define i64 @test_llrintl_zero()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 0
-define i64 @test_llrintl_zero() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK00000000000000000000)
- ret i64 %val
-}
-
-; NaN
-; CHECK-LABEL: define i64 @test_llrintl_nan()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrintl_nan() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
- ret i64 %val
-}
-
-; +Inf
-; CHECK-LABEL: define i64 @test_llrintl_posinf()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrintl_posinf() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
- ret i64 %val
-}
-
-; -Inf
-; CHECK-LABEL: define i64 @test_llrintl_neginf()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrintl_neginf() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
- ret i64 %val
-}
\ No newline at end of file
diff --git a/llvm/test/Transforms/InstCombine/llrintl_fp80.ll b/llvm/test/Transforms/InstCombine/llrintl_fp80.ll
deleted file mode 100644
index 04d54d95163ef..0000000000000
--- a/llvm/test/Transforms/InstCombine/llrintl_fp80.ll
+++ /dev/null
@@ -1,65 +0,0 @@
-; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
-declare i64 @llrintl(x86_fp80)
-
-; Positive number
-; CHECK-LABEL: define i64 @test_llrintl_pos()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 4
-define i64 @test_llrintl_pos() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK4000E000000000000000)
- ret i64 %val
-}
-
-; Negative number
-; CHECK-LABEL: define i64 @test_llrintl_neg()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 -2
-define i64 @test_llrintl_neg() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xKC000A000000000000000)
- ret i64 %val
-}
-
-; Zero
-; CHECK-LABEL: define i64 @test_llrintl_zero()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: ret i64 0
-define i64 @test_llrintl_zero() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK00000000000000000000)
- ret i64 %val
-}
-
-; NaN
-; CHECK-LABEL: define i64 @test_llrintl_nan()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrintl_nan() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK7FFF8000000000000000)
- ret i64 %val
-}
-
-; +Inf
-; CHECK-LABEL: define i64 @test_llrintl_posinf()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrintl_posinf() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xK7FFF0000000000000000)
- ret i64 %val
-}
-
-; -Inf
-; CHECK-LABEL: define i64 @test_llrintl_neginf()
-; CHECK-NEXT: entry:
-; CHECK-NEXT: %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
-; CHECK-NEXT: ret i64 %val
-define i64 @test_llrintl_neginf() {
-entry:
- %val = call i64 @llrintl(x86_fp80 0xKFFFF0000000000000000)
- ret i64 %val
-}
\ No newline at end of file
>From 97b35145fc300a6f4bb2b0fe9fda729fd031d57e Mon Sep 17 00:00:00 2001
From: Pratheek Gowda BS <pratheekgowdabs at example.com>
Date: Wed, 10 Dec 2025 18:52:52 +0530
Subject: [PATCH 3/5] resolved the format issue and pushed
---
.../llvm/Analysis/TargetLibraryInfo.td | 22 +-
llvm/lib/Analysis/ConstantFolding.cpp | 456 +++++++++---------
.../tools/llvm-tli-checker/ps4-tli-check.yaml | 14 +-
3 files changed, 243 insertions(+), 249 deletions(-)
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.td b/llvm/include/llvm/Analysis/TargetLibraryInfo.td
index 4e19bb11429f6..d51ef5324bfeb 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.td
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.td
@@ -1142,13 +1142,13 @@ def ilogbf : TargetLibCall<"ilogbf", Int, [Flt]>;
def ilogbl : TargetLibCall<"ilogbl", Int, [LDbl]>;
/// long long llrint(double x);
-def llrint : TargetLibCall<"llrint",LLong,[Dbl]>;
+def llrint : TargetLibCall<"llrint", LLong, [Dbl]>;
-///long long llrintf( float x);
-def llrintf : TargetLibCall<"llrintf",LLong,[Flt]>;
+/// long long llrintf( float x);
+def llrintf : TargetLibCall<"llrintf", LLong, [Flt]>;
-///long long llrintl(long double x);
-def llrintl : TargetLibCall<"llrintl",LLong,[LDbl]>;
+/// long long llrintl(long double x);
+def llrintl : TargetLibCall<"llrintl", LLong, [LDbl]>;
/// double logb(double x);
def logb : TargetLibCall<"logb", Dbl, [Dbl]>;
@@ -1245,22 +1245,22 @@ def nearbyintf : TargetLibCall<"nearbyintf", Flt, [Flt]>;
def nearbyintl : TargetLibCall<"nearbyintl", LDbl, [LDbl]>;
/// double nextafter(double x, double y);
-def nextafter : TargetLibCall< "nextafter", Dbl, [Dbl, Dbl]>;
+def nextafter : TargetLibCall<"nextafter", Dbl, [Dbl, Dbl]>;
/// float nextafterf(float x, float y);
-def nextafterf : TargetLibCall< "nextafterf", Flt, [Flt, Flt]>;
+def nextafterf : TargetLibCall<"nextafterf", Flt, [Flt, Flt]>;
/// long double nextafterl(long double x, long double y);
-def nextafterl : TargetLibCall< "nextafterl", LDbl, [LDbl, LDbl]>;
+def nextafterl : TargetLibCall<"nextafterl", LDbl, [LDbl, LDbl]>;
/// double nexttoward(double x, long double y);
-def nexttoward : TargetLibCall< "nexttoward", Dbl, [Dbl, LDbl]>;
+def nexttoward : TargetLibCall<"nexttoward", Dbl, [Dbl, LDbl]>;
/// float nexttowardf(float x, long double y);
-def nexttowardf : TargetLibCall< "nexttowardf", Flt, [Flt, LDbl]>;
+def nexttowardf : TargetLibCall<"nexttowardf", Flt, [Flt, LDbl]>;
/// long double nexttowardl(long double x, long double y);
-def nexttowardl : TargetLibCall< "nexttowardl", LDbl, [LDbl, LDbl]>;
+def nexttowardl : TargetLibCall<"nexttowardl", LDbl, [LDbl, LDbl]>;
/// uint32_t ntohl(uint32_t netlong);
def ntohl : TargetLibCall<"ntohl", Int32, [Int32]>;
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp
index 25f9af733fd78..3d248df16ffc6 100644
--- a/llvm/lib/Analysis/ConstantFolding.cpp
+++ b/llvm/lib/Analysis/ConstantFolding.cpp
@@ -122,8 +122,8 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
unsigned NumSrcElts = cast<FixedVectorType>(VTy)->getNumElements();
Type *SrcEltTy = VTy->getElementType();
- // If the vector is a vector of floating point, convert it to vector of int
- // to simplify things.
+ // If the vector is a vector of floating point, convert it to vector of
+ // int to simplify things.
if (SrcEltTy->isFloatingPointTy()) {
unsigned FPWidth = SrcEltTy->getPrimitiveSizeInBits();
auto *SrcIVTy = FixedVectorType::get(
@@ -133,8 +133,8 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
}
APInt Result(DL.getTypeSizeInBits(DestTy), 0);
- if (Constant *CE = foldConstVectorToAPInt(Result, DestTy, C,
- SrcEltTy, NumSrcElts, DL))
+ if (Constant *CE = foldConstVectorToAPInt(Result, DestTy, C, SrcEltTy,
+ NumSrcElts, DL))
return CE;
if (isa<IntegerType>(DestTy))
@@ -218,17 +218,17 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
// more elements.
bool isLittleEndian = DL.isLittleEndian();
- SmallVector<Constant*, 32> Result;
+ SmallVector<Constant *, 32> Result;
if (NumDstElt < NumSrcElt) {
// Handle: bitcast (<4 x i32> <i32 0, i32 1, i32 2, i32 3> to <2 x i64>)
Constant *Zero = Constant::getNullValue(DstEltTy);
- unsigned Ratio = NumSrcElt/NumDstElt;
+ unsigned Ratio = NumSrcElt / NumDstElt;
unsigned SrcBitSize = SrcEltTy->getPrimitiveSizeInBits();
unsigned SrcElt = 0;
for (unsigned i = 0; i != NumDstElt; ++i) {
// Build each element of the result.
Constant *Elt = Zero;
- unsigned ShiftAmt = isLittleEndian ? 0 : SrcBitSize*(Ratio-1);
+ unsigned ShiftAmt = isLittleEndian ? 0 : SrcBitSize * (Ratio - 1);
for (unsigned j = 0; j != Ratio; ++j) {
Constant *Src = C->getAggregateElement(SrcElt++);
if (isa_and_nonnull<UndefValue>(Src))
@@ -236,12 +236,12 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
cast<VectorType>(C->getType())->getElementType());
else
Src = dyn_cast_or_null<ConstantInt>(Src);
- if (!Src) // Reject constantexpr elements.
+ if (!Src) // Reject constantexpr elements.
return ConstantExpr::getBitCast(C, DestTy);
// Zero extend the element to the right size.
- Src = ConstantFoldCastOperand(Instruction::ZExt, Src, Elt->getType(),
- DL);
+ Src =
+ ConstantFoldCastOperand(Instruction::ZExt, Src, Elt->getType(), DL);
assert(Src && "Constant folding cannot fail on plain integers");
// Shift it to the right place, depending on endianness.
@@ -262,7 +262,7 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
}
// Handle: bitcast (<2 x i64> <i64 0, i64 1> to <4 x i32>)
- unsigned Ratio = NumDstElt/NumSrcElt;
+ unsigned Ratio = NumDstElt / NumSrcElt;
unsigned DstBitSize = DL.getTypeSizeInBits(DstEltTy);
// Loop over each source value, expanding into multiple results.
@@ -282,7 +282,7 @@ Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
if (!Src)
return ConstantExpr::getBitCast(C, DestTy);
- unsigned ShiftAmt = isLittleEndian ? 0 : DstBitSize*(Ratio-1);
+ unsigned ShiftAmt = isLittleEndian ? 0 : DstBitSize * (Ratio - 1);
for (unsigned j = 0; j != Ratio; ++j) {
// Shift the piece of the value into the right place, depending on
// endianness.
@@ -325,7 +325,8 @@ bool llvm::IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
// Otherwise, if this isn't a constant expr, bail out.
auto *CE = dyn_cast<ConstantExpr>(C);
- if (!CE) return false;
+ if (!CE)
+ return false;
// Look through ptr->int and ptr->ptr casts.
if (CE->getOpcode() == Instruction::PtrToInt ||
@@ -446,7 +447,7 @@ bool ReadDataFromGlobal(Constant *C, uint64_t ByteOffset, unsigned char *CurPtr,
if ((CI->getBitWidth() & 7) != 0)
return false;
const APInt &Val = CI->getValue();
- unsigned IntBytes = unsigned(CI->getBitWidth()/8);
+ unsigned IntBytes = unsigned(CI->getBitWidth() / 8);
for (unsigned i = 0; i != BytesLeft && ByteOffset != IntBytes; ++i) {
unsigned n = ByteOffset;
@@ -463,11 +464,11 @@ bool ReadDataFromGlobal(Constant *C, uint64_t ByteOffset, unsigned char *CurPtr,
C = FoldBitCast(C, Type::getInt64Ty(C->getContext()), DL);
return ReadDataFromGlobal(C, ByteOffset, CurPtr, BytesLeft, DL);
}
- if (CFP->getType()->isFloatTy()){
+ if (CFP->getType()->isFloatTy()) {
C = FoldBitCast(C, Type::getInt32Ty(C->getContext()), DL);
return ReadDataFromGlobal(C, ByteOffset, CurPtr, BytesLeft, DL);
}
- if (CFP->getType()->isHalfTy()){
+ if (CFP->getType()->isHalfTy()) {
C = FoldBitCast(C, Type::getInt16Ty(C->getContext()), DL);
return ReadDataFromGlobal(C, ByteOffset, CurPtr, BytesLeft, DL);
}
@@ -522,8 +523,8 @@ bool ReadDataFromGlobal(Constant *C, uint64_t ByteOffset, unsigned char *CurPtr,
} else {
NumElts = cast<FixedVectorType>(C->getType())->getNumElements();
EltTy = cast<FixedVectorType>(C->getType())->getElementType();
- // TODO: For non-byte-sized vectors, current implementation assumes there is
- // padding to the next byte boundary between elements.
+ // TODO: For non-byte-sized vectors, current implementation assumes there
+ // is padding to the next byte boundary between elements.
if (!DL.typeSizeEqualsStoreSize(EltTy))
return false;
@@ -585,14 +586,17 @@ Constant *FoldReinterpretLoadFromConst(Constant *C, Type *LoadTy,
if (Res->isNullValue() && !LoadTy->isX86_AMXTy())
// Materializing a zero can be done trivially without a bitcast
return Constant::getNullValue(LoadTy);
- Type *CastTy = LoadTy->isPtrOrPtrVectorTy() ? DL.getIntPtrType(LoadTy) : LoadTy;
+ Type *CastTy =
+ LoadTy->isPtrOrPtrVectorTy() ? DL.getIntPtrType(LoadTy) : LoadTy;
Res = FoldBitCast(Res, CastTy, DL);
if (LoadTy->isPtrOrPtrVectorTy()) {
- // For vector of pointer, we needed to first convert to a vector of integer, then do vector inttoptr
+ // For vector of pointer, we needed to first convert to a vector of
+ // integer, then do vector inttoptr
if (Res->isNullValue() && !LoadTy->isX86_AMXTy())
return Constant::getNullValue(LoadTy);
if (DL.isNonIntegralPointerType(LoadTy->getScalarType()))
- // Be careful not to replace a load of an addrspace value with an inttoptr here
+ // Be careful not to replace a load of an addrspace value with an
+ // inttoptr here
return nullptr;
Res = ConstantExpr::getIntToPtr(Res, LoadTy);
}
@@ -752,11 +756,11 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, Type *Ty,
return nullptr;
C = cast<Constant>(C->stripAndAccumulateConstantOffsets(
- DL, Offset, /* AllowNonInbounds */ true));
+ DL, Offset, /* AllowNonInbounds */ true));
if (C == GV)
- if (Constant *Result = ConstantFoldLoadFromConst(GV->getInitializer(), Ty,
- Offset, DL))
+ if (Constant *Result =
+ ConstantFoldLoadFromConst(GV->getInitializer(), Ty, Offset, DL))
return Result;
// If this load comes from anywhere in a uniform constant global, the value
@@ -833,7 +837,7 @@ Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0, Constant *Op1,
// PtrToInt may change the bitwidth so we have convert to the right size
// first.
return ConstantInt::get(Op0->getType(), Offs1.zextOrTrunc(OpSize) -
- Offs2.zextOrTrunc(OpSize));
+ Offs2.zextOrTrunc(OpSize));
}
}
@@ -850,11 +854,10 @@ Constant *CastGEPIndices(Type *SrcElemTy, ArrayRef<Constant *> Ops,
Type *IntIdxScalarTy = IntIdxTy->getScalarType();
bool Any = false;
- SmallVector<Constant*, 32> NewIdxs;
+ SmallVector<Constant *, 32> NewIdxs;
for (unsigned i = 1, e = Ops.size(); i != e; ++i) {
- if ((i == 1 ||
- !isa<StructType>(GetElementPtrInst::getIndexedType(
- SrcElemTy, Ops.slice(1, i - 1)))) &&
+ if ((i == 1 || !isa<StructType>(GetElementPtrInst::getIndexedType(
+ SrcElemTy, Ops.slice(1, i - 1)))) &&
Ops[i]->getType()->getScalarType() != IntIdxScalarTy) {
Any = true;
Type *NewType =
@@ -985,9 +988,8 @@ Constant *SymbolicallyEvaluateGEP(const GEPOperator *GEP,
// Otherwise canonicalize this to a single ptradd.
LLVMContext &Ctx = Ptr->getContext();
- return ConstantExpr::getGetElementPtr(Type::getInt8Ty(Ctx), Ptr,
- ConstantInt::get(Ctx, Offset), NW,
- InRange);
+ return ConstantExpr::getGetElementPtr(
+ Type::getInt8Ty(Ctx), Ptr, ConstantInt::get(Ctx, Offset), NW, InRange);
}
/// Attempt to constant fold an instruction with the
@@ -1045,7 +1047,8 @@ Constant *ConstantFoldInstOperandsImpl(const Value *InstOrCE, unsigned Opcode,
return CE->getWithOperands(Ops);
switch (Opcode) {
- default: return nullptr;
+ default:
+ return nullptr;
case Instruction::ICmp:
case Instruction::FCmp: {
auto *C = cast<CmpInst>(InstOrCE);
@@ -1196,9 +1199,11 @@ Constant *llvm::ConstantFoldInstOperands(const Instruction *I,
AllowNonDeterministic);
}
-Constant *llvm::ConstantFoldCompareInstOperands(
- unsigned IntPredicate, Constant *Ops0, Constant *Ops1, const DataLayout &DL,
- const TargetLibraryInfo *TLI, const Instruction *I) {
+Constant *llvm::ConstantFoldCompareInstOperands(unsigned IntPredicate,
+ Constant *Ops0, Constant *Ops1,
+ const DataLayout &DL,
+ const TargetLibraryInfo *TLI,
+ const Instruction *I) {
CmpInst::Predicate Predicate = (CmpInst::Predicate)IntPredicate;
// fold: icmp (inttoptr x), null -> icmp x, 0
// fold: icmp null, (inttoptr x) -> icmp 0, x
@@ -1972,7 +1977,8 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
return true;
default:
return false;
- case Intrinsic::not_intrinsic: break;
+ case Intrinsic::not_intrinsic:
+ break;
}
if (!F->hasName() || Call->isStrictFP())
@@ -2277,11 +2283,10 @@ Constant *ConstantFoldSSEConvertToInt(const APFloat &Val, bool roundTowardZero,
uint64_t UIntVal;
bool isExact = false;
- APFloat::roundingMode mode = roundTowardZero? APFloat::rmTowardZero
- : APFloat::rmNearestTiesToEven;
- APFloat::opStatus status =
- Val.convertToInteger(MutableArrayRef(UIntVal), ResultWidth,
- IsSigned, mode, &isExact);
+ APFloat::roundingMode mode =
+ roundTowardZero ? APFloat::rmTowardZero : APFloat::rmNearestTiesToEven;
+ APFloat::opStatus status = Val.convertToInteger(
+ MutableArrayRef(UIntVal), ResultWidth, IsSigned, mode, &isExact);
if (status != APFloat::opOK &&
(!roundTowardZero || status != APFloat::opInexact))
return nullptr;
@@ -2406,8 +2411,7 @@ static Constant *constantFoldCanonicalize(const Type *Ty, const CallBase *CI,
}
static Constant *ConstantFoldScalarCall1(StringRef Name,
- Intrinsic::ID IntrinsicID,
- Type *Ty,
+ Intrinsic::ID IntrinsicID, Type *Ty,
ArrayRef<Constant *> Operands,
const TargetLibraryInfo *TLI,
const CallBase *Call) {
@@ -2426,8 +2430,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
// cosine(arg) is between -1 and 1. cosine(invalid arg) is NaN.
// ctpop() is between 0 and bitwidth, pick 0 for undef.
// fptoui.sat and fptosi.sat can always fold to zero (for a zero input).
- if (IntrinsicID == Intrinsic::cos ||
- IntrinsicID == Intrinsic::ctpop ||
+ if (IntrinsicID == Intrinsic::cos || IntrinsicID == Intrinsic::ctpop ||
IntrinsicID == Intrinsic::fptoui_sat ||
IntrinsicID == Intrinsic::fptosi_sat ||
IntrinsicID == Intrinsic::canonicalize)
@@ -2446,8 +2449,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
// If instruction is not yet put in a basic block (e.g. when cloning
// a function during inlining), Call's caller may not be available.
// So check Call's BB first before querying Call->getCaller.
- const Function *Caller =
- Call->getParent() ? Call->getCaller() : nullptr;
+ const Function *Caller = Call->getParent() ? Call->getCaller() : nullptr;
if (Caller &&
!NullPointerIsDefined(
Caller, Operands[0]->getType()->getPointerAddressSpace())) {
@@ -2521,17 +2523,16 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
// Use internal versions of these intrinsics.
-
if (IntrinsicID == Intrinsic::llrint) {
unsigned Width = Ty->getIntegerBitWidth();
APSInt Result(Width, /*isUnsigned=*/false);
bool IsExact = false;
APFloat Tmp = U;
- APFloat::opStatus Status = Tmp.convertToInteger(
- Result, APFloat::rmNearestTiesToEven, &IsExact);
+ APFloat::opStatus Status =
+ Tmp.convertToInteger(Result, APFloat::rmNearestTiesToEven, &IsExact);
- // Allowed: opOK or opInexact
- // Disallowed: opInvalidOp (overflow)
+ // Allowed: opOK or opInexact
+ // Disallowed: opInvalidOp (overflow)
if (Status == APFloat::opOK || Status == APFloat::opInexact)
return ConstantInt::get(Ty, Result);
@@ -2733,149 +2734,150 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
const APFloat &APF = Op->getValueAPF();
switch (IntrinsicID) {
- default: break;
- case Intrinsic::log:
- return ConstantFoldFP(log, APF, Ty);
- case Intrinsic::log2:
- // TODO: What about hosts that lack a C99 library?
- return ConstantFoldFP(log2, APF, Ty);
- case Intrinsic::log10:
- // TODO: What about hosts that lack a C99 library?
- return ConstantFoldFP(log10, APF, Ty);
- case Intrinsic::exp:
- return ConstantFoldFP(exp, APF, Ty);
- case Intrinsic::exp2:
- // Fold exp2(x) as pow(2, x), in case the host lacks a C99 library.
- return ConstantFoldBinaryFP(pow, APFloat(2.0), APF, Ty);
- case Intrinsic::exp10:
- // Fold exp10(x) as pow(10, x), in case the host lacks a C99 library.
- return ConstantFoldBinaryFP(pow, APFloat(10.0), APF, Ty);
- case Intrinsic::sin:
- return ConstantFoldFP(sin, APF, Ty);
- case Intrinsic::cos:
- return ConstantFoldFP(cos, APF, Ty);
- case Intrinsic::sinh:
- return ConstantFoldFP(sinh, APF, Ty);
- case Intrinsic::cosh:
- return ConstantFoldFP(cosh, APF, Ty);
- case Intrinsic::atan:
- // Implement optional behavior from C's Annex F for +/-0.0.
- if (U.isZero())
- return ConstantFP::get(Ty->getContext(), U);
- return ConstantFoldFP(atan, APF, Ty);
- case Intrinsic::sqrt:
- return ConstantFoldFP(sqrt, APF, Ty);
-
- // NVVM Intrinsics:
- case Intrinsic::nvvm_ceil_ftz_f:
- case Intrinsic::nvvm_ceil_f:
- case Intrinsic::nvvm_ceil_d:
- return ConstantFoldFP(
- ceil, APF, Ty,
- nvvm::GetNVVMDenormMode(
- nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
-
- case Intrinsic::nvvm_fabs_ftz:
- case Intrinsic::nvvm_fabs:
- return ConstantFoldFP(
- fabs, APF, Ty,
- nvvm::GetNVVMDenormMode(
- nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
-
- case Intrinsic::nvvm_floor_ftz_f:
- case Intrinsic::nvvm_floor_f:
- case Intrinsic::nvvm_floor_d:
- return ConstantFoldFP(
- floor, APF, Ty,
- nvvm::GetNVVMDenormMode(
- nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
-
- case Intrinsic::nvvm_rcp_rm_ftz_f:
- case Intrinsic::nvvm_rcp_rn_ftz_f:
- case Intrinsic::nvvm_rcp_rp_ftz_f:
- case Intrinsic::nvvm_rcp_rz_ftz_f:
- case Intrinsic::nvvm_rcp_rm_d:
- case Intrinsic::nvvm_rcp_rm_f:
- case Intrinsic::nvvm_rcp_rn_d:
- case Intrinsic::nvvm_rcp_rn_f:
- case Intrinsic::nvvm_rcp_rp_d:
- case Intrinsic::nvvm_rcp_rp_f:
- case Intrinsic::nvvm_rcp_rz_d:
- case Intrinsic::nvvm_rcp_rz_f: {
- APFloat::roundingMode RoundMode = nvvm::GetRCPRoundingMode(IntrinsicID);
- bool IsFTZ = nvvm::RCPShouldFTZ(IntrinsicID);
-
- auto Denominator = IsFTZ ? FTZPreserveSign(APF) : APF;
- APFloat Res = APFloat::getOne(APF.getSemantics());
- APFloat::opStatus Status = Res.divide(Denominator, RoundMode);
-
- if (Status == APFloat::opOK || Status == APFloat::opInexact) {
- if (IsFTZ)
- Res = FTZPreserveSign(Res);
- return ConstantFP::get(Ty->getContext(), Res);
- }
- return nullptr;
+ default:
+ break;
+ case Intrinsic::log:
+ return ConstantFoldFP(log, APF, Ty);
+ case Intrinsic::log2:
+ // TODO: What about hosts that lack a C99 library?
+ return ConstantFoldFP(log2, APF, Ty);
+ case Intrinsic::log10:
+ // TODO: What about hosts that lack a C99 library?
+ return ConstantFoldFP(log10, APF, Ty);
+ case Intrinsic::exp:
+ return ConstantFoldFP(exp, APF, Ty);
+ case Intrinsic::exp2:
+ // Fold exp2(x) as pow(2, x), in case the host lacks a C99 library.
+ return ConstantFoldBinaryFP(pow, APFloat(2.0), APF, Ty);
+ case Intrinsic::exp10:
+ // Fold exp10(x) as pow(10, x), in case the host lacks a C99 library.
+ return ConstantFoldBinaryFP(pow, APFloat(10.0), APF, Ty);
+ case Intrinsic::sin:
+ return ConstantFoldFP(sin, APF, Ty);
+ case Intrinsic::cos:
+ return ConstantFoldFP(cos, APF, Ty);
+ case Intrinsic::sinh:
+ return ConstantFoldFP(sinh, APF, Ty);
+ case Intrinsic::cosh:
+ return ConstantFoldFP(cosh, APF, Ty);
+ case Intrinsic::atan:
+ // Implement optional behavior from C's Annex F for +/-0.0.
+ if (U.isZero())
+ return ConstantFP::get(Ty->getContext(), U);
+ return ConstantFoldFP(atan, APF, Ty);
+ case Intrinsic::sqrt:
+ return ConstantFoldFP(sqrt, APF, Ty);
+
+ // NVVM Intrinsics:
+ case Intrinsic::nvvm_ceil_ftz_f:
+ case Intrinsic::nvvm_ceil_f:
+ case Intrinsic::nvvm_ceil_d:
+ return ConstantFoldFP(
+ ceil, APF, Ty,
+ nvvm::GetNVVMDenormMode(
+ nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
+
+ case Intrinsic::nvvm_fabs_ftz:
+ case Intrinsic::nvvm_fabs:
+ return ConstantFoldFP(
+ fabs, APF, Ty,
+ nvvm::GetNVVMDenormMode(
+ nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
+
+ case Intrinsic::nvvm_floor_ftz_f:
+ case Intrinsic::nvvm_floor_f:
+ case Intrinsic::nvvm_floor_d:
+ return ConstantFoldFP(
+ floor, APF, Ty,
+ nvvm::GetNVVMDenormMode(
+ nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
+
+ case Intrinsic::nvvm_rcp_rm_ftz_f:
+ case Intrinsic::nvvm_rcp_rn_ftz_f:
+ case Intrinsic::nvvm_rcp_rp_ftz_f:
+ case Intrinsic::nvvm_rcp_rz_ftz_f:
+ case Intrinsic::nvvm_rcp_rm_d:
+ case Intrinsic::nvvm_rcp_rm_f:
+ case Intrinsic::nvvm_rcp_rn_d:
+ case Intrinsic::nvvm_rcp_rn_f:
+ case Intrinsic::nvvm_rcp_rp_d:
+ case Intrinsic::nvvm_rcp_rp_f:
+ case Intrinsic::nvvm_rcp_rz_d:
+ case Intrinsic::nvvm_rcp_rz_f: {
+ APFloat::roundingMode RoundMode = nvvm::GetRCPRoundingMode(IntrinsicID);
+ bool IsFTZ = nvvm::RCPShouldFTZ(IntrinsicID);
+
+ auto Denominator = IsFTZ ? FTZPreserveSign(APF) : APF;
+ APFloat Res = APFloat::getOne(APF.getSemantics());
+ APFloat::opStatus Status = Res.divide(Denominator, RoundMode);
+
+ if (Status == APFloat::opOK || Status == APFloat::opInexact) {
+ if (IsFTZ)
+ Res = FTZPreserveSign(Res);
+ return ConstantFP::get(Ty->getContext(), Res);
}
+ return nullptr;
+ }
- case Intrinsic::nvvm_round_ftz_f:
- case Intrinsic::nvvm_round_f:
- case Intrinsic::nvvm_round_d: {
- // nvvm_round is lowered to PTX cvt.rni, which will round to nearest
- // integer, choosing even integer if source is equidistant between two
- // integers, so the semantics are closer to "rint" rather than "round".
- bool IsFTZ = nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID);
- auto V = IsFTZ ? FTZPreserveSign(APF) : APF;
- V.roundToIntegral(APFloat::rmNearestTiesToEven);
- return ConstantFP::get(Ty->getContext(), V);
- }
+ case Intrinsic::nvvm_round_ftz_f:
+ case Intrinsic::nvvm_round_f:
+ case Intrinsic::nvvm_round_d: {
+ // nvvm_round is lowered to PTX cvt.rni, which will round to nearest
+ // integer, choosing even integer if source is equidistant between two
+ // integers, so the semantics are closer to "rint" rather than "round".
+ bool IsFTZ = nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID);
+ auto V = IsFTZ ? FTZPreserveSign(APF) : APF;
+ V.roundToIntegral(APFloat::rmNearestTiesToEven);
+ return ConstantFP::get(Ty->getContext(), V);
+ }
- case Intrinsic::nvvm_saturate_ftz_f:
- case Intrinsic::nvvm_saturate_d:
- case Intrinsic::nvvm_saturate_f: {
- bool IsFTZ = nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID);
- auto V = IsFTZ ? FTZPreserveSign(APF) : APF;
- if (V.isNegative() || V.isZero() || V.isNaN())
- return ConstantFP::getZero(Ty);
- APFloat One = APFloat::getOne(APF.getSemantics());
- if (V > One)
- return ConstantFP::get(Ty->getContext(), One);
- return ConstantFP::get(Ty->getContext(), APF);
- }
+ case Intrinsic::nvvm_saturate_ftz_f:
+ case Intrinsic::nvvm_saturate_d:
+ case Intrinsic::nvvm_saturate_f: {
+ bool IsFTZ = nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID);
+ auto V = IsFTZ ? FTZPreserveSign(APF) : APF;
+ if (V.isNegative() || V.isZero() || V.isNaN())
+ return ConstantFP::getZero(Ty);
+ APFloat One = APFloat::getOne(APF.getSemantics());
+ if (V > One)
+ return ConstantFP::get(Ty->getContext(), One);
+ return ConstantFP::get(Ty->getContext(), APF);
+ }
- case Intrinsic::nvvm_sqrt_rn_ftz_f:
- case Intrinsic::nvvm_sqrt_f:
- case Intrinsic::nvvm_sqrt_rn_d:
- case Intrinsic::nvvm_sqrt_rn_f:
- if (APF.isNegative())
- return nullptr;
- return ConstantFoldFP(
- sqrt, APF, Ty,
- nvvm::GetNVVMDenormMode(
- nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
-
- // AMDGCN Intrinsics:
- case Intrinsic::amdgcn_cos:
- case Intrinsic::amdgcn_sin: {
- double V = getValueAsDouble(Op);
- if (V < -256.0 || V > 256.0)
- // The gfx8 and gfx9 architectures handle arguments outside the range
- // [-256, 256] differently. This should be a rare case so bail out
- // rather than trying to handle the difference.
- return nullptr;
- bool IsCos = IntrinsicID == Intrinsic::amdgcn_cos;
- double V4 = V * 4.0;
- if (V4 == floor(V4)) {
- // Force exact results for quarter-integer inputs.
- const double SinVals[4] = { 0.0, 1.0, 0.0, -1.0 };
- V = SinVals[((int)V4 + (IsCos ? 1 : 0)) & 3];
- } else {
- if (IsCos)
- V = cos(V * 2.0 * numbers::pi);
- else
- V = sin(V * 2.0 * numbers::pi);
- }
- return GetConstantFoldFPValue(V, Ty);
+ case Intrinsic::nvvm_sqrt_rn_ftz_f:
+ case Intrinsic::nvvm_sqrt_f:
+ case Intrinsic::nvvm_sqrt_rn_d:
+ case Intrinsic::nvvm_sqrt_rn_f:
+ if (APF.isNegative())
+ return nullptr;
+ return ConstantFoldFP(
+ sqrt, APF, Ty,
+ nvvm::GetNVVMDenormMode(
+ nvvm::UnaryMathIntrinsicShouldFTZ(IntrinsicID)));
+
+ // AMDGCN Intrinsics:
+ case Intrinsic::amdgcn_cos:
+ case Intrinsic::amdgcn_sin: {
+ double V = getValueAsDouble(Op);
+ if (V < -256.0 || V > 256.0)
+ // The gfx8 and gfx9 architectures handle arguments outside the range
+ // [-256, 256] differently. This should be a rare case so bail out
+ // rather than trying to handle the difference.
+ return nullptr;
+ bool IsCos = IntrinsicID == Intrinsic::amdgcn_cos;
+ double V4 = V * 4.0;
+ if (V4 == floor(V4)) {
+ // Force exact results for quarter-integer inputs.
+ const double SinVals[4] = {0.0, 1.0, 0.0, -1.0};
+ V = SinVals[((int)V4 + (IsCos ? 1 : 0)) & 3];
+ } else {
+ if (IsCos)
+ V = cos(V * 2.0 * numbers::pi);
+ else
+ V = sin(V * 2.0 * numbers::pi);
}
+ return GetConstantFoldFPValue(V, Ty);
+ }
}
if (!TLI)
@@ -3128,7 +3130,8 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
if (Operands[0]->getType()->isVectorTy()) {
auto *Op = cast<Constant>(Operands[0]);
switch (IntrinsicID) {
- default: break;
+ default:
+ break;
case Intrinsic::vector_reduce_add:
case Intrinsic::vector_reduce_mul:
case Intrinsic::vector_reduce_and:
@@ -3149,7 +3152,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
dyn_cast_or_null<ConstantFP>(Op->getAggregateElement(0U)))
return ConstantFoldSSEConvertToInt(FPOp->getValueAPF(),
/*roundTowardZero=*/false, Ty,
- /*IsSigned*/true);
+ /*IsSigned*/ true);
break;
case Intrinsic::x86_sse_cvttss2si:
case Intrinsic::x86_sse_cvttss2si64:
@@ -3159,7 +3162,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
dyn_cast_or_null<ConstantFP>(Op->getAggregateElement(0U)))
return ConstantFoldSSEConvertToInt(FPOp->getValueAPF(),
/*roundTowardZero=*/true, Ty,
- /*IsSigned*/true);
+ /*IsSigned*/ true);
break;
case Intrinsic::wasm_anytrue:
@@ -3584,16 +3587,18 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
case Intrinsic::is_fpclass: {
FPClassTest Mask = static_cast<FPClassTest>(Op2C->getZExtValue());
bool Result =
- ((Mask & fcSNan) && Op1V.isNaN() && Op1V.isSignaling()) ||
- ((Mask & fcQNan) && Op1V.isNaN() && !Op1V.isSignaling()) ||
- ((Mask & fcNegInf) && Op1V.isNegInfinity()) ||
- ((Mask & fcNegNormal) && Op1V.isNormal() && Op1V.isNegative()) ||
- ((Mask & fcNegSubnormal) && Op1V.isDenormal() && Op1V.isNegative()) ||
- ((Mask & fcNegZero) && Op1V.isZero() && Op1V.isNegative()) ||
- ((Mask & fcPosZero) && Op1V.isZero() && !Op1V.isNegative()) ||
- ((Mask & fcPosSubnormal) && Op1V.isDenormal() && !Op1V.isNegative()) ||
- ((Mask & fcPosNormal) && Op1V.isNormal() && !Op1V.isNegative()) ||
- ((Mask & fcPosInf) && Op1V.isPosInfinity());
+ ((Mask & fcSNan) && Op1V.isNaN() && Op1V.isSignaling()) ||
+ ((Mask & fcQNan) && Op1V.isNaN() && !Op1V.isSignaling()) ||
+ ((Mask & fcNegInf) && Op1V.isNegInfinity()) ||
+ ((Mask & fcNegNormal) && Op1V.isNormal() && Op1V.isNegative()) ||
+ ((Mask & fcNegSubnormal) && Op1V.isDenormal() &&
+ Op1V.isNegative()) ||
+ ((Mask & fcNegZero) && Op1V.isZero() && Op1V.isNegative()) ||
+ ((Mask & fcPosZero) && Op1V.isZero() && !Op1V.isNegative()) ||
+ ((Mask & fcPosSubnormal) && Op1V.isDenormal() &&
+ !Op1V.isNegative()) ||
+ ((Mask & fcPosNormal) && Op1V.isNormal() && !Op1V.isNegative()) ||
+ ((Mask & fcPosInf) && Op1V.isPosInfinity());
return ConstantInt::get(Ty, Result);
}
case Intrinsic::powi: {
@@ -3630,7 +3635,8 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
return nullptr;
switch (IntrinsicID) {
- default: break;
+ default:
+ break;
case Intrinsic::smax:
case Intrinsic::smin:
case Intrinsic::umax:
@@ -3685,7 +3691,8 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
APInt Res;
bool Overflow;
switch (IntrinsicID) {
- default: llvm_unreachable("Invalid case");
+ default:
+ llvm_unreachable("Invalid case");
case Intrinsic::sadd_with_overflow:
Res = C0->sadd_ov(*C1, Overflow);
break;
@@ -3706,9 +3713,8 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
break;
}
Constant *Ops[] = {
- ConstantInt::get(Ty->getContext(), Res),
- ConstantInt::get(Type::getInt1Ty(Ty->getContext()), Overflow)
- };
+ ConstantInt::get(Ty->getContext(), Res),
+ ConstantInt::get(Type::getInt1Ty(Ty->getContext()), Overflow)};
return ConstantStruct::get(cast<StructType>(Ty), Ops);
}
case Intrinsic::uadd_sat:
@@ -3782,7 +3788,8 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
cast<ConstantInt>(Operands[1])->getValue() == 4) {
auto *Op = cast<Constant>(Operands[0]);
switch (IntrinsicID) {
- default: break;
+ default:
+ break;
case Intrinsic::x86_avx512_vcvtss2si32:
case Intrinsic::x86_avx512_vcvtss2si64:
case Intrinsic::x86_avx512_vcvtsd2si32:
@@ -3791,7 +3798,7 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
dyn_cast_or_null<ConstantFP>(Op->getAggregateElement(0U)))
return ConstantFoldSSEConvertToInt(FPOp->getValueAPF(),
/*roundTowardZero=*/false, Ty,
- /*IsSigned*/true);
+ /*IsSigned*/ true);
break;
case Intrinsic::x86_avx512_vcvtss2usi32:
case Intrinsic::x86_avx512_vcvtss2usi64:
@@ -3801,7 +3808,7 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
dyn_cast_or_null<ConstantFP>(Op->getAggregateElement(0U)))
return ConstantFoldSSEConvertToInt(FPOp->getValueAPF(),
/*roundTowardZero=*/false, Ty,
- /*IsSigned*/false);
+ /*IsSigned*/ false);
break;
case Intrinsic::x86_avx512_cvttss2si:
case Intrinsic::x86_avx512_cvttss2si64:
@@ -3811,7 +3818,7 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
dyn_cast_or_null<ConstantFP>(Op->getAggregateElement(0U)))
return ConstantFoldSSEConvertToInt(FPOp->getValueAPF(),
/*roundTowardZero=*/true, Ty,
- /*IsSigned*/true);
+ /*IsSigned*/ true);
break;
case Intrinsic::x86_avx512_cvttss2usi:
case Intrinsic::x86_avx512_cvttss2usi64:
@@ -3821,7 +3828,7 @@ static Constant *ConstantFoldIntrinsicCall2(Intrinsic::ID IntrinsicID, Type *Ty,
dyn_cast_or_null<ConstantFP>(Op->getAggregateElement(0U)))
return ConstantFoldSSEConvertToInt(FPOp->getValueAPF(),
/*roundTowardZero=*/true, Ty,
- /*IsSigned*/false);
+ /*IsSigned*/ false);
break;
}
}
@@ -3924,8 +3931,7 @@ static Constant *ConstantFoldAMDGCNPermIntrinsic(ArrayRef<Constant *> Operands,
}
static Constant *ConstantFoldScalarCall3(StringRef Name,
- Intrinsic::ID IntrinsicID,
- Type *Ty,
+ Intrinsic::ID IntrinsicID, Type *Ty,
ArrayRef<Constant *> Operands,
const TargetLibraryInfo *TLI,
const CallBase *Call) {
@@ -3957,7 +3963,8 @@ static Constant *ConstantFoldScalarCall3(StringRef Name,
}
switch (IntrinsicID) {
- default: break;
+ default:
+ break;
case Intrinsic::amdgcn_fma_legacy: {
// The legacy behaviour is that multiplying +/- 0.0 by anything, even
// NaN or infinity, gives +0.0.
@@ -4088,8 +4095,7 @@ static Constant *ConstantFoldScalarCall3(StringRef Name,
}
static Constant *ConstantFoldScalarCall(StringRef Name,
- Intrinsic::ID IntrinsicID,
- Type *Ty,
+ Intrinsic::ID IntrinsicID, Type *Ty,
ArrayRef<Constant *> Operands,
const TargetLibraryInfo *TLI,
const CallBase *Call) {
@@ -4567,16 +4573,16 @@ Constant *llvm::ConstantFoldCall(const CallBase *Call, Function *F,
StringRef Name = F->getName();
if (auto *FVTy = dyn_cast<FixedVectorType>(Ty))
- return ConstantFoldFixedVectorCall(
- Name, IID, FVTy, Operands, F->getDataLayout(), TLI, Call);
+ return ConstantFoldFixedVectorCall(Name, IID, FVTy, Operands,
+ F->getDataLayout(), TLI, Call);
if (auto *SVTy = dyn_cast<ScalableVectorType>(Ty))
- return ConstantFoldScalableVectorCall(
- Name, IID, SVTy, Operands, F->getDataLayout(), TLI, Call);
+ return ConstantFoldScalableVectorCall(Name, IID, SVTy, Operands,
+ F->getDataLayout(), TLI, Call);
if (auto *StTy = dyn_cast<StructType>(Ty))
- return ConstantFoldStructCall(Name, IID, StTy, Operands,
- F->getDataLayout(), TLI, Call);
+ return ConstantFoldStructCall(Name, IID, StTy, Operands, F->getDataLayout(),
+ TLI, Call);
// TODO: If this is a library function, we already discovered that above,
// so we should pass the LibFunc, not the name (and it might be better
diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
index e4f3827242944..f882cb6dc7c0d 100644
--- a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
+++ b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
@@ -689,19 +689,7 @@ DynamicSymbols:
- Name: ilogbl
Type: STT_FUNC
Section: .text
- Binding: STB_GLOBAL
- - Name: llrint
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: llrintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: llrintl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
+ Binding: STB_GLOBAL
- Name: logb
Type: STT_FUNC
Section: .text
>From a174f2d61988b90bda764f4591b76ea227e6e145 Mon Sep 17 00:00:00 2001
From: pratheekhassan21 <148260426+pratheekhassan21 at users.noreply.github.com>
Date: Wed, 10 Dec 2025 22:37:34 +0530
Subject: [PATCH 4/5] Delete .github/workflows/bazel-checks.yml
---
.github/workflows/bazel-checks.yml | 61 ------------------------------
1 file changed, 61 deletions(-)
delete mode 100644 .github/workflows/bazel-checks.yml
diff --git a/.github/workflows/bazel-checks.yml b/.github/workflows/bazel-checks.yml
deleted file mode 100644
index 3e1cde6172422..0000000000000
--- a/.github/workflows/bazel-checks.yml
+++ /dev/null
@@ -1,61 +0,0 @@
-name: Bazel Checks
-
-permissions:
- contents: read
-
-on:
- push:
- paths:
- - '.github/workflows/bazel-checks.yml'
- - 'utils/bazel/**'
- branches:
- - main
- pull_request:
- paths:
- - '.github/workflows/bazel-checks.yml'
- - 'utils/bazel/**'
-
-jobs:
- buildifier:
- name: "Buildifier"
- runs-on: ubuntu-24.04
- if: github.repository == 'llvm/llvm-project'
- steps:
- - name: Fetch LLVM sources
- uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- - name: Setup Buildifier
- run: |
- sudo curl -L https://github.com/bazelbuild/buildtools/releases/download/v8.2.1/buildifier-linux-amd64 -o /usr/bin/buildifier
- sudo chmod +x /usr/bin/buildifier
- - name: Run Buildifier
- run: |
- buildifier --mode=check $(find ./utils/bazel -name *BUILD*)
-
- bazel-build:
- name: "Bazel Build/Test"
- # Only run on US Central workers so we only have to keep one cache warm as
- # the cache buckets are per cluster.
- runs-on:
- group: llvm-premerge-cluster-us-central
- labels: llvm-premerge-linux-runners
- if: github.repository == 'llvm/llvm-project'
- steps:
- - name: Fetch LLVM sources
- uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- # TODO(boomanaiden154): We should use a purpose built container for this. Move
- # over when we have fixed the issues with using custom containers with Github
- # ARC in GKE.
- - name: Setup System Dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y libmpfr-dev libpfm4-dev m4 libedit-dev
- sudo curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-amd64.deb --fail > /tmp/bazelisk.deb
- sudo apt-get install -y /tmp/bazelisk.deb
- rm /tmp/bazelisk.deb
- - name: Build/Test
- working-directory: utils/bazel
- run: |
- bazelisk test --config=ci --sandbox_base="" \
- --remote_cache=https://storage.googleapis.com/$CACHE_GCS_BUCKET-bazel \
- --google_default_credentials \
- @llvm-project//... //...
>From d0dc23a9db05de8561401e73b74c2430400c3c1a Mon Sep 17 00:00:00 2001
From: pratheekhassan21 <148260426+pratheekhassan21 at users.noreply.github.com>
Date: Wed, 10 Dec 2025 22:43:16 +0530
Subject: [PATCH 5/5] Delete
llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
---
.../tools/llvm-tli-checker/ps4-tli-check.yaml | 1193 -----------------
1 file changed, 1193 deletions(-)
delete mode 100644 llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
diff --git a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml b/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
deleted file mode 100644
index f882cb6dc7c0d..0000000000000
--- a/llvm/test/tools/llvm-tli-checker/ps4-tli-check.yaml
+++ /dev/null
@@ -1,1193 +0,0 @@
-# REQUIRES: x86-registered-target
-#
-## This produces a static object that matches expectations for PS4/PS5.
-# RUN: yaml2obj %s -DTYPE=ET_REL -DLABEL=Symbols -DZDAPV=_ZdaPv -o=%t1
-# RUN: llvm-tli-checker --triple=x86_64-scei-ps4 %t1 | FileCheck %s
-# RUN: llvm-tli-checker --triple=x86_64-sie-ps5 %t1 | FileCheck %s
-#
-## This produces a dynamic object that has _ZdaPvj instead of _ZdaPv.
-# RUN: yaml2obj %s -DTYPE=ET_DYN -DLABEL=DynamicSymbols -DZDAPV=_ZdaPvj -o=%t2
-# RUN: llvm-tli-checker --triple x86_64-scei-ps4 %t2 | \
-# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \
-# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
-#
-## --report=discrepancy is the default, check we get the same output.
-# RUN: llvm-tli-checker --triple x86_64-scei-ps4 %t2 --report=discrepancy | \
-# RUN: FileCheck %s --check-prefixes=WRONG_SUMMARY,WRONG_DETAIL \
-# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
-#
-## --report=summary should not print the details (checked by the
-## implicit-check-not strings).
-# RUN: llvm-tli-checker --triple x86_64-scei-ps4 %t2 --report=summary | \
-# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \
-# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
-#
-## --separate implies --report=summary.
-# RUN: llvm-tli-checker --triple x86_64-scei-ps4 %t2 --separate | \
-# RUN: FileCheck %s --check-prefix=WRONG_SUMMARY \
-# RUN: --implicit-check-not="==" --implicit-check-not="<<" --implicit-check-not=">>"
-#
-## Verify --dump-tli reports the full set.
-# RUN: llvm-tli-checker --triple x86_64-scei-ps4 --dump-tli > %t3.txt
-# RUN: FileCheck %s --check-prefix=AVAIL --input-file %t3.txt
-# RUN: FileCheck %s --check-prefix=UNAVAIL --input-file %t3.txt
-#
-# CHECK: << Total TLI yes SDK no: 18
-# CHECK: >> Total TLI no SDK yes: 0
-# CHECK: == Total TLI yes SDK yes: 277
-#
-# WRONG_DETAIL: << TLI yes SDK no : '_ZdaPv' aka operator delete[](void*)
-# WRONG_DETAIL: >> TLI no SDK yes: '_ZdaPvj' aka operator delete[](void*, unsigned int)
-# WRONG_DETAIL-COUNT-8: << TLI yes SDK no : {{.*}}__hot_cold_t
-# WRONG_DETAIL-COUNT-4: << TLI yes SDK no : '__size_returning_new{{.*}}
-# WRONG_DETAIL: << TLI yes SDK no : 'fmaximum_num'
-# WRONG_DETAIL: << TLI yes SDK no : 'fmaximum_numf'
-# WRONG_DETAIL: << TLI yes SDK no : 'fmaximum_numl'
-# WRONG_DETAIL: << TLI yes SDK no : 'fminimum_num'
-# WRONG_DETAIL: << TLI yes SDK no : 'fminimum_numf'
-# WRONG_DETAIL: << TLI yes SDK no : 'fminimum_numl'
-# WRONG_SUMMARY: << Total TLI yes SDK no: 19{{$}}
-# WRONG_SUMMARY: >> Total TLI no SDK yes: 1{{$}}
-# WRONG_SUMMARY: == Total TLI yes SDK yes: 276
-#
-## The -COUNT suffix doesn't care if there are too many matches, so check
-## the exact count first; the two directives should add up to that.
-## Yes, this means additions to TLI will fail this test, but the argument
-## to -COUNT can't be an expression.
-# AVAIL: TLI knows 530 symbols, 295 available
-# AVAIL-COUNT-295: {{^}} available
-# AVAIL-NOT: {{^}} available
-# UNAVAIL-COUNT-235: not available
-# UNAVAIL-NOT: not available
-
-## This is a large file so it's worth telling lit to stop here.
-# END.
-
---- !ELF
-FileHeader:
- Class: ELFCLASS64
- Data: ELFDATA2LSB
- OSABI: ELFOSABI_FREEBSD
- Type: ET_DYN
- Machine: EM_X86_64
-Sections:
- - Name: .text
- Type: SHT_PROGBITS
-DynamicSymbols:
-# This is an undefined symbol that is known to TLI but not in the
-# available set for PS4, showing the tool will ignore undefined symbols.
-# Omitting the Section attribute makes it undefined.
- - Name: memcpy_chk
- Type: STT_FUNC
- Binding: STB_GLOBAL
-# This will be either _ZdaPv or _ZdaPvj (see yaml2obj invocations above).
- - Name: [[ZDAPV]]
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
-# The rest of these are the remaining symbols needed for PS4.
- - Name: _ZdaPvRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdaPvSt11align_val_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdaPvSt11align_val_tRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdaPvm
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdaPvmSt11align_val_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdlPv
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdlPvRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdlPvSt11align_val_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdlPvSt11align_val_tRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdlPvm
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZdlPvmSt11align_val_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _Znam
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZnamRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZnamSt11align_val_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZnamSt11align_val_tRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _Znwm
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZnwmRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZnwmSt11align_val_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZnwmSt11align_val_tRKSt9nothrow_t
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: __cxa_atexit
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: __cxa_guard_abort
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: __cxa_guard_acquire
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: __cxa_throw
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: __cxa_guard_release
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: abs
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: acos
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: acosf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: acosh
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: acoshf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: acoshl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: acosl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: aligned_alloc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: asin
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: asinf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: asinh
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: asinhf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: asinhl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: asinl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atan
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atan2
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atan2f
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atan2l
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atanh
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atanhf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atanhl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atanl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atexit
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: abort
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: exit
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _Exit
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: _ZSt9terminatev
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atof
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atoi
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atol
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: atoll
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: calloc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cbrt
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cbrtf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cbrtl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ceil
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ceilf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ceill
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: clearerr
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: copysign
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: copysignf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: copysignl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cos
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cosf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cosh
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: coshf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: coshl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: cosl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: erf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: erff
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: erfl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tgamma
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tgammaf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tgammal
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: exp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: exp2
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: exp2f
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: exp2l
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: expf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: expl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: expm1
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: expm1f
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: expm1l
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fabs
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fabsf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fabsl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fclose
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fdopen
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: feof
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ferror
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fflush
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fgetc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fgetpos
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fgets
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fileno
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: floor
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: floorf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: floorl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmax
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmaxf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmaxl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmin
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fminf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fminl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmod
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmodf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fmodl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fopen
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fputc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fputs
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fread
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: free
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: frexp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: frexpf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: frexpl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fscanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fseek
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fsetpos
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ftell
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fwrite
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: getc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: getchar
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: gets
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: hypot
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: hypotf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: hypotl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: isdigit
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: labs
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ldexp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ldexpf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ldexpl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: llabs
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log10
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log10f
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log10l
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log1p
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log1pf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log1pl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log2
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log2f
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: log2l
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ilogb
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ilogbf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ilogbl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: logb
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: logbf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: logbl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: logf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: logl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: malloc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: memalign
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: memchr
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: memcmp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: memcpy
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: memmove
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: memset
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: mktime
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: modf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: modff
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: modfl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nan
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nanl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nearbyint
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nearbyintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nearbyintl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nextafter
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nextafterf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nextafterl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nexttoward
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nexttowardf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: nexttowardl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: perror
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: posix_memalign
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: pow
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: powf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: powl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: printf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: putc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: putchar
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: puts
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: qsort
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: realloc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remainder
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remainderf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remainderl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remove
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remquo
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remquof
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: remquol
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fdim
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fdimf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: fdiml
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: rewind
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: rint
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: rintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: rintl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: round
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: roundf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: roundl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scalbln
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scalblnf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scalblnl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scalbn
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scalbnf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scalbnl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: scanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: setbuf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: setvbuf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sin
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sinf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sincos
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sincosf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sincosl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sinh
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sinhf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sinhl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sinl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: snprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sqrt
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sqrtf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sqrtl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: sscanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strcasecmp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strcat
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strchr
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strcmp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strcoll
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strcpy
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strcspn
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strdup
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strlen
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strncasecmp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strncat
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strncmp
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strncpy
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strpbrk
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strrchr
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strspn
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strstr
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtod
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtof
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtok
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtok_r
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtol
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtold
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtoll
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtoul
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strtoull
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: strxfrm
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tan
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tanh
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tanhf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tanhl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: tanl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: trunc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: truncf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: truncl
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: ungetc
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vfprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vfscanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vscanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vsnprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vsprintf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: vsscanf
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
- - Name: wcslen
- Type: STT_FUNC
- Section: .text
- Binding: STB_GLOBAL
-...
More information about the llvm-commits
mailing list