[llvm] [InstCombine] Add support for Instruction combining of hyperbolic functions (PR #173730)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 8 12:58:29 PST 2026
================
@@ -0,0 +1,79 @@
+; 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: [[TMP0:%.*]] = tail call nnan double @llvm.cosh.f64(double [[X:%.*]])
+; CHECK-NEXT: ret double [[TMP0]]
+;
+entry:
+ %fneg = fneg double %x
+ %ret = tail call nnan double @llvm.cosh.f64(double %fneg)
+ ret double %ret
+}
+
+define double @tgt_cosh(double noundef %x) {
+; CHECK-LABEL: @tgt_cosh(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = tail call nnan double @llvm.cosh.f64(double [[X:%.*]])
+; CHECK-NEXT: ret double [[TMP0]]
+;
+entry:
+ %ret = tail call nnan double @llvm.cosh.f64(double %x)
+ ret double %ret
+}
----------------
arsenm wrote:
Don't need these no-op tat tests
https://github.com/llvm/llvm-project/pull/173730
More information about the llvm-commits
mailing list