[llvm] 8d20dd0 - [ConstFolding] move tests for copysign; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 26 14:16:38 PST 2019
Author: Sanjay Patel
Date: 2019-11-26T16:54:46-05:00
New Revision: 8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd
URL: https://github.com/llvm/llvm-project/commit/8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd
DIFF: https://github.com/llvm/llvm-project/commit/8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd.diff
LOG: [ConstFolding] move tests for copysign; NFC
InstCombine doesn't have any transforms for copysign currently.
Added:
llvm/test/Analysis/ConstantFolding/copysign.ll
Modified:
Removed:
llvm/test/Transforms/InstCombine/copysign.ll
################################################################################
diff --git a/llvm/test/Analysis/ConstantFolding/copysign.ll b/llvm/test/Analysis/ConstantFolding/copysign.ll
new file mode 100644
index 000000000000..228ffcb47053
--- /dev/null
+++ b/llvm/test/Analysis/ConstantFolding/copysign.ll
@@ -0,0 +1,53 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -constprop < %s | FileCheck %s
+
+declare float @llvm.copysign.f32(float, float)
+declare double @llvm.copysign.f64(double, double)
+
+define float @f32_01() {
+; CHECK-LABEL: @f32_01(
+; CHECK-NEXT: ret float -1.000000e+00
+;
+ %x = call float @llvm.copysign.f32(float 1.0, float -2.0)
+ ret float %x
+}
+
+define float @f32_02() {
+; CHECK-LABEL: @f32_02(
+; CHECK-NEXT: ret float 2.000000e+00
+;
+ %x = call float @llvm.copysign.f32(float -2.0, float 1.0)
+ ret float %x
+}
+
+define float @f32_03() {
+; CHECK-LABEL: @f32_03(
+; CHECK-NEXT: ret float -2.000000e+00
+;
+ %x = call float @llvm.copysign.f32(float -2.0, float -1.0)
+ ret float %x
+}
+
+define double @f64_01() {
+; CHECK-LABEL: @f64_01(
+; CHECK-NEXT: ret double -1.000000e+00
+;
+ %x = call double @llvm.copysign.f64(double 1.0, double -2.0)
+ ret double %x
+}
+
+define double @f64_02() {
+; CHECK-LABEL: @f64_02(
+; CHECK-NEXT: ret double 1.000000e+00
+;
+ %x = call double @llvm.copysign.f64(double -1.0, double 2.0)
+ ret double %x
+}
+
+define double @f64_03() {
+; CHECK-LABEL: @f64_03(
+; CHECK-NEXT: ret double -1.000000e+00
+;
+ %x = call double @llvm.copysign.f64(double -1.0, double -2.0)
+ ret double %x
+}
diff --git a/llvm/test/Transforms/InstCombine/copysign.ll b/llvm/test/Transforms/InstCombine/copysign.ll
deleted file mode 100644
index 556b79999b02..000000000000
--- a/llvm/test/Transforms/InstCombine/copysign.ll
+++ /dev/null
@@ -1,49 +0,0 @@
-; RUN: opt -S -instcombine < %s | FileCheck %s
-
-declare float @llvm.copysign.f32(float, float) #0
-declare double @llvm.copysign.f64(double, double) #0
-
-; CHECK-LABEL: @constant_fold_copysign_f32_01
-; CHECK-NEXT: ret float -1.000000e+00
-define float @constant_fold_copysign_f32_01() #0 {
- %x = call float @llvm.copysign.f32(float 1.0, float -2.0) #0
- ret float %x
-}
-
-; CHECK-LABEL: @constant_fold_copysign_f32_02
-; CHECK-NEXT: ret float 2.000000e+00
-define float @constant_fold_copysign_f32_02() #0 {
- %x = call float @llvm.copysign.f32(float -2.0, float 1.0) #0
- ret float %x
-}
-
-; CHECK-LABEL: @constant_fold_copysign_f32_03
-; CHECK-NEXT: ret float -2.000000e+00
-define float @constant_fold_copysign_f32_03() #0 {
- %x = call float @llvm.copysign.f32(float -2.0, float -1.0) #0
- ret float %x
-}
-
-; CHECK-LABEL: @constant_fold_copysign_f64_01
-; CHECK-NEXT: ret double -1.000000e+00
-define double @constant_fold_copysign_f64_01() #0 {
- %x = call double @llvm.copysign.f64(double 1.0, double -2.0) #0
- ret double %x
-}
-
-; CHECK-LABEL: @constant_fold_copysign_f64_02
-; CHECK-NEXT: ret double 1.000000e+00
-define double @constant_fold_copysign_f64_02() #0 {
- %x = call double @llvm.copysign.f64(double -1.0, double 2.0) #0
- ret double %x
-}
-
-; CHECK-LABEL: @constant_fold_copysign_f64_03
-; CHECK-NEXT: ret double -1.000000e+00
-define double @constant_fold_copysign_f64_03() #0 {
- %x = call double @llvm.copysign.f64(double -1.0, double -2.0) #0
- ret double %x
-}
-
-
-attributes #0 = { nounwind readnone }
More information about the llvm-commits
mailing list