[llvm] 48a3a1e - [InstSimplify] add tests for copysign; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 26 14:40:18 PST 2019
Author: Sanjay Patel
Date: 2019-11-26T17:23:30-05:00
New Revision: 48a3a1e090611d1a71cb3c027e9316d048a67324
URL: https://github.com/llvm/llvm-project/commit/48a3a1e090611d1a71cb3c027e9316d048a67324
DIFF: https://github.com/llvm/llvm-project/commit/48a3a1e090611d1a71cb3c027e9316d048a67324.diff
LOG: [InstSimplify] add tests for copysign; NFC
Added:
Modified:
llvm/test/Transforms/InstSimplify/call.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll
index 2fc0841a8e15..b0f35ab37155 100644
--- a/llvm/test/Transforms/InstSimplify/call.ll
+++ b/llvm/test/Transforms/InstSimplify/call.ll
@@ -920,3 +920,24 @@ define double @fmuladd_nan_addend_neginf_inf(double %x, i1 %y) {
%r = call double @llvm.fmuladd.f64(double %notnan, double 0xfff0000000000000, double 0x7ff0000000000000)
ret double %r
}
+
+declare float @llvm.copysign.f32(float, float)
+declare <2 x double> @llvm.copysign.v2f64(<2 x double>, <2 x double>)
+
+define float @copysign_same_operand(float %x) {
+; CHECK-LABEL: @copysign_same_operand(
+; CHECK-NEXT: [[R:%.*]] = call float @llvm.copysign.f32(float [[X:%.*]], float [[X]])
+; CHECK-NEXT: ret float [[R]]
+;
+ %r = call float @llvm.copysign.f32(float %x, float %x)
+ ret float %r
+}
+
+define <2 x double> @copysign_same_operand_vec(<2 x double> %x) {
+; CHECK-LABEL: @copysign_same_operand_vec(
+; CHECK-NEXT: [[R:%.*]] = call <2 x double> @llvm.copysign.v2f64(<2 x double> [[X:%.*]], <2 x double> [[X]])
+; CHECK-NEXT: ret <2 x double> [[R]]
+;
+ %r = call <2 x double> @llvm.copysign.v2f64(<2 x double> %x, <2 x double> %x)
+ ret <2 x double> %r
+}
More information about the llvm-commits
mailing list