[llvm] Precommit Tests (PR #173730)
Kshitij Paranjape via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 27 08:46:10 PST 2025
https://github.com/kshitijvp created https://github.com/llvm/llvm-project/pull/173730
Fixes llvm/llvm-project#173706
>From aadde5ef9e3bf13ce20977290709ff46e55256b3 Mon Sep 17 00:00:00 2001
From: Kshitij Paranjape <kshitijvparanjape at gmail.com>
Date: Sat, 27 Dec 2025 21:41:14 +0530
Subject: [PATCH] Precommit Tests
---
.../InstCombine/hyperbolic-functions.ll | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 llvm/test/Transforms/InstCombine/hyperbolic-functions.ll
diff --git a/llvm/test/Transforms/InstCombine/hyperbolic-functions.ll b/llvm/test/Transforms/InstCombine/hyperbolic-functions.ll
new file mode 100644
index 0000000000000..0d5631152057f
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/hyperbolic-functions.ll
@@ -0,0 +1,84 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+define double @src_cosh(double noundef %x) {
+; CHECK-LABEL: @src_cosh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[FNEG:%.*]] = fneg double [[X:%.*]]
+; CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.cosh.f64(double [[FNEG]])
+; CHECK-NEXT: ret double [[TMP0]]
+;
+entry:
+ %fneg = fneg double %x
+ %1 = tail call double @llvm.cosh.f64(double %fneg)
+ ret double %1
+}
+
+define double @tgt_cosh(double noundef %x) {
+; CHECK-LABEL: @tgt_cosh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.cosh.f64(double [[X:%.*]])
+; CHECK-NEXT: ret double [[TMP0]]
+;
+entry:
+ %1 = tail call double @llvm.cosh.f64(double %x)
+ ret double %1
+}
+
+declare double @llvm.cosh.f64(double)
+
+define double @src_tanh(double noundef %x) {
+; CHECK-LABEL: @src_tanh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[FNEG:%.*]] = fneg double [[X:%.*]]
+; CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.tanh.f64(double [[FNEG]])
+; CHECK-NEXT: [[FNEG1:%.*]] = fneg double [[TMP0]]
+; CHECK-NEXT: ret double [[FNEG1]]
+;
+entry:
+ %fneg = fneg double %x
+ %0 = tail call double @llvm.tanh.f64(double %fneg)
+ %fneg1 = fneg double %0
+ ret double %fneg1
+}
+
+define double @tgt_tanh(double noundef %x) {
+; CHECK-LABEL: @tgt_tanh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.tanh.f64(double [[X:%.*]])
+; CHECK-NEXT: ret double [[TMP0]]
+;
+entry:
+ %0 = tail call double @llvm.tanh.f64(double %x)
+ ret double %0
+}
+
+declare double @llvm.tanh.f64(double)
+
+define double @src_sinh(double noundef %x) {
+; CHECK-LABEL: @src_sinh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[FNEG:%.*]] = fneg double [[X:%.*]]
+; CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.sinh.f64(double [[FNEG]])
+; CHECK-NEXT: [[FNEG1:%.*]] = fneg double [[TMP0]]
+; CHECK-NEXT: ret double [[FNEG1]]
+;
+entry:
+ %fneg = fneg double %x
+ %0 = tail call double @llvm.sinh.f64(double %fneg)
+ %fneg1 = fneg double %0
+ ret double %fneg1
+}
+
+declare double @llvm.sinh.f64(double)
+
+define double @tgt_sinh(double noundef %x) {
+; CHECK-LABEL: @tgt_sinh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = tail call double @llvm.sinh.f64(double [[X:%.*]])
+; CHECK-NEXT: ret double [[TMP0]]
+;
+entry:
+ %0 = tail call double @llvm.sinh.f64(double %x)
+ ret double %0
+}
More information about the llvm-commits
mailing list