|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: opt -S -passes=instsimplify < %s | FileCheck %s |
| 3 | + |
| 4 | +define double @test_atan_0() { |
| 5 | +; CHECK-LABEL: define double @test_atan_0() { |
| 6 | +; CHECK-NEXT: ret double 0.000000e+00 |
| 7 | +; |
| 8 | + %result = call double @llvm.atan.f64(double 0.0) |
| 9 | + ret double %result |
| 10 | +} |
| 11 | + |
| 12 | +define double @test_atan_one() { |
| 13 | +; CHECK-LABEL: define double @test_atan_one() { |
| 14 | +; CHECK-NEXT: ret double 0x3FE921FB54442D18 |
| 15 | +; |
| 16 | + %res = call double @llvm.atan.f64(double 1.0) |
| 17 | + ret double %res |
| 18 | +} |
| 19 | + |
| 20 | +define <2 x double> @test_atan_v2() { |
| 21 | +; CHECK-LABEL: define <2 x double> @test_atan_v2() { |
| 22 | +; CHECK-NEXT: ret <2 x double> zeroinitializer |
| 23 | +; |
| 24 | + %result = call <2 x double> @llvm.atan.v2f64(<2 x double> zeroinitializer) |
| 25 | + ret <2 x double> %result |
| 26 | +} |
| 27 | + |
| 28 | +define double @test_atan_neg0() { |
| 29 | +; CHECK-LABEL: define double @test_atan_neg0() { |
| 30 | +; CHECK-NEXT: ret double -0.000000e+00 |
| 31 | +; |
| 32 | + %res = call double @llvm.atan.f64(double -0.0) |
| 33 | + ret double %res |
| 34 | +} |
| 35 | + |
| 36 | +define double @test_atan_poison() { |
| 37 | +; CHECK-LABEL: define double @test_atan_poison() { |
| 38 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.atan.f64(double poison) |
| 39 | +; CHECK-NEXT: ret double [[RES]] |
| 40 | +; |
| 41 | + %res = call double @llvm.atan.f64(double poison) |
| 42 | + ret double %res |
| 43 | +} |
| 44 | + |
| 45 | +define double @test_atan_undef() { |
| 46 | +; CHECK-LABEL: define double @test_atan_undef() { |
| 47 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.atan.f64(double undef) |
| 48 | +; CHECK-NEXT: ret double [[RES]] |
| 49 | +; |
| 50 | + %res = call double @llvm.atan.f64(double undef) |
| 51 | + ret double %res |
| 52 | +} |
| 53 | + |
| 54 | +define double @test_atan_snan() { |
| 55 | +; CHECK-LABEL: define double @test_atan_snan() { |
| 56 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.atan.f64(double 0x7FF0000000000001) |
| 57 | +; CHECK-NEXT: ret double [[RES]] |
| 58 | +; |
| 59 | + %res = call double @llvm.atan.f64(double 0x7ff0000000000001) |
| 60 | + ret double %res |
| 61 | +} |
| 62 | + |
| 63 | +define double @test_atan_qnan() { |
| 64 | +; CHECK-LABEL: define double @test_atan_qnan() { |
| 65 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.atan.f64(double 0x7FF8000000000000) |
| 66 | +; CHECK-NEXT: ret double [[RES]] |
| 67 | +; |
| 68 | + %res = call double @llvm.atan.f64(double 0x7ff8000000000000) |
| 69 | + ret double %res |
| 70 | +} |
| 71 | + |
| 72 | +define double @test_atan_pos_inf() { |
| 73 | +; CHECK-LABEL: define double @test_atan_pos_inf() { |
| 74 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.atan.f64(double 0x7FF0000000000000) |
| 75 | +; CHECK-NEXT: ret double [[RES]] |
| 76 | +; |
| 77 | + %res = call double @llvm.atan.f64(double 0x7ff0000000000000) |
| 78 | + ret double %res |
| 79 | +} |
| 80 | + |
| 81 | +define double @test_atan_neg_inf() { |
| 82 | +; CHECK-LABEL: define double @test_atan_neg_inf() { |
| 83 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.atan.f64(double 0xFFF0000000000000) |
| 84 | +; CHECK-NEXT: ret double [[RES]] |
| 85 | +; |
| 86 | + %res = call double @llvm.atan.f64(double 0xfff0000000000000) |
| 87 | + ret double %res |
| 88 | +} |
0 commit comments