diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2019-11-26 17:23:30 -0500 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2019-11-26 17:23:30 -0500 |
| commit | 48a3a1e090611d1a71cb3c027e9316d048a67324 (patch) | |
| tree | d8320859354c02cfba6c05dbad78f141c0ca8ade /llvm/test/Transforms/InstSimplify | |
| parent | 8d20dd0b0694af6a43b63fd9ebd5c27db653b7dd (diff) | |
| download | bcm5719-llvm-48a3a1e090611d1a71cb3c027e9316d048a67324.tar.gz bcm5719-llvm-48a3a1e090611d1a71cb3c027e9316d048a67324.zip | |
[InstSimplify] add tests for copysign; NFC
Diffstat (limited to 'llvm/test/Transforms/InstSimplify')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/call.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/call.ll b/llvm/test/Transforms/InstSimplify/call.ll index 2fc0841a8e1..b0f35ab3715 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 +} |

