diff options
author | Sanjay Patel <spatel@rotateright.com> | 2019-11-26 16:52:18 -0500 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2019-11-26 16:54:46 -0500 |
commit | 8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd (patch) | |
tree | 0af3246177497ee23befe52c3ce02e5d78db7c85 /llvm/test | |
parent | 11074bfffee022fbbdca177a96dc2eaf2df6d936 (diff) | |
download | bcm5719-llvm-8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd.tar.gz bcm5719-llvm-8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd.zip |
[ConstFolding] move tests for copysign; NFC
InstCombine doesn't have any transforms for copysign currently.
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Analysis/ConstantFolding/copysign.ll | 53 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/copysign.ll | 49 |
2 files changed, 53 insertions, 49 deletions
diff --git a/llvm/test/Analysis/ConstantFolding/copysign.ll b/llvm/test/Analysis/ConstantFolding/copysign.ll new file mode 100644 index 00000000000..228ffcb4705 --- /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 556b79999b0..00000000000 --- 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 } |