|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 |
2 | | -; RUN: opt -S -passes=early-cse < %s | FileCheck %s |
| 2 | +; RUN: opt -S -passes=instsimplify < %s | FileCheck %s |
3 | 3 |
|
4 | | -define double @test_sinh() { |
5 | | -; CHECK-LABEL: define double @test_sinh() { |
6 | | -; CHECK-NEXT: ret double 0.000000e+00 |
| 4 | +define double @test_sinh_0() { |
| 5 | +; CHECK-LABEL: define double @test_sinh_0() { |
| 6 | +; CHECK-NEXT: [[RESULT:%.*]] = call double @llvm.sinh.f64(double 0.000000e+00) |
| 7 | +; CHECK-NEXT: ret double [[RESULT]] |
7 | 8 | ; |
8 | 9 | %result = call double @llvm.sinh.f64(double 0.0) |
9 | 10 | ret double %result |
10 | 11 | } |
11 | 12 |
|
| 13 | +define double @test_sinh_ln2() { |
| 14 | +; CHECK-LABEL: define double @test_sinh_ln2() { |
| 15 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x3FE62E42FEFA3BDC) |
| 16 | +; CHECK-NEXT: ret double [[RES]] |
| 17 | +; |
| 18 | + %res = call double @llvm.sinh.f64(double 0.69314718056) |
| 19 | + ret double %res |
| 20 | +} |
| 21 | + |
| 22 | +define double @test_sinh_ln5() { |
| 23 | +; CHECK-LABEL: define double @test_sinh_ln5() { |
| 24 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x3FF9C041F7ED4511) |
| 25 | +; CHECK-NEXT: ret double [[RES]] |
| 26 | +; |
| 27 | + %res = call double @llvm.sinh.f64(double 1.60943791243) |
| 28 | + ret double %res |
| 29 | +} |
| 30 | + |
12 | 31 | define <2 x double> @test_sinh_v2() { |
13 | 32 | ; CHECK-LABEL: define <2 x double> @test_sinh_v2() { |
14 | | -; CHECK-NEXT: ret <2 x double> zeroinitializer |
| 33 | +; CHECK-NEXT: [[RESULT:%.*]] = call <2 x double> @llvm.sinh.v2f64(<2 x double> zeroinitializer) |
| 34 | +; CHECK-NEXT: ret <2 x double> [[RESULT]] |
15 | 35 | ; |
16 | 36 | %result = call <2 x double> @llvm.sinh.v2f64(<2 x double> zeroinitializer) |
17 | 37 | ret <2 x double> %result |
18 | 38 | } |
19 | 39 |
|
20 | | -define double @test_cosh() { |
21 | | -; CHECK-LABEL: define double @test_cosh() { |
22 | | -; CHECK-NEXT: ret double 1.000000e+00 |
| 40 | +define double @test_sinh_neg0() { |
| 41 | +; CHECK-LABEL: define double @test_sinh_neg0() { |
| 42 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double -0.000000e+00) |
| 43 | +; CHECK-NEXT: ret double [[RES]] |
| 44 | +; |
| 45 | + %res = call double @llvm.sinh.f64(double -0.0) |
| 46 | + ret double %res |
| 47 | +} |
| 48 | + |
| 49 | +define double @test_sinh_poison() { |
| 50 | +; CHECK-LABEL: define double @test_sinh_poison() { |
| 51 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double poison) |
| 52 | +; CHECK-NEXT: ret double [[RES]] |
| 53 | +; |
| 54 | + %res = call double @llvm.sinh.f64(double poison) |
| 55 | + ret double %res |
| 56 | +} |
| 57 | + |
| 58 | +define double @test_sinh_undef() { |
| 59 | +; CHECK-LABEL: define double @test_sinh_undef() { |
| 60 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double undef) |
| 61 | +; CHECK-NEXT: ret double [[RES]] |
| 62 | +; |
| 63 | + %res = call double @llvm.sinh.f64(double undef) |
| 64 | + ret double %res |
| 65 | +} |
| 66 | + |
| 67 | +define double @test_sinh_snan() { |
| 68 | +; CHECK-LABEL: define double @test_sinh_snan() { |
| 69 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x7FF0000000000001) |
| 70 | +; CHECK-NEXT: ret double [[RES]] |
| 71 | +; |
| 72 | + %res = call double @llvm.sinh.f64(double 0x7ff0000000000001) |
| 73 | + ret double %res |
| 74 | +} |
| 75 | + |
| 76 | +define double @test_sinh_qnan() { |
| 77 | +; CHECK-LABEL: define double @test_sinh_qnan() { |
| 78 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x7FF8000000000000) |
| 79 | +; CHECK-NEXT: ret double [[RES]] |
| 80 | +; |
| 81 | + %res = call double @llvm.sinh.f64(double 0x7ff8000000000000) |
| 82 | + ret double %res |
| 83 | +} |
| 84 | + |
| 85 | +define double @test_sinh_pos_inf() { |
| 86 | +; CHECK-LABEL: define double @test_sinh_pos_inf() { |
| 87 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0x7FF0000000000000) |
| 88 | +; CHECK-NEXT: ret double [[RES]] |
| 89 | +; |
| 90 | + %res = call double @llvm.sinh.f64(double 0x7ff0000000000000) |
| 91 | + ret double %res |
| 92 | +} |
| 93 | + |
| 94 | +define double @test_sinh_neg_inf() { |
| 95 | +; CHECK-LABEL: define double @test_sinh_neg_inf() { |
| 96 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.sinh.f64(double 0xFFF0000000000000) |
| 97 | +; CHECK-NEXT: ret double [[RES]] |
| 98 | +; |
| 99 | + %res = call double @llvm.sinh.f64(double 0xfff0000000000000) |
| 100 | + ret double %res |
| 101 | +} |
| 102 | + |
| 103 | +define double @test_cosh_0() { |
| 104 | +; CHECK-LABEL: define double @test_cosh_0() { |
| 105 | +; CHECK-NEXT: [[RESULT:%.*]] = call double @llvm.cosh.f64(double 0.000000e+00) |
| 106 | +; CHECK-NEXT: ret double [[RESULT]] |
23 | 107 | ; |
24 | 108 | %result = call double @llvm.cosh.f64(double 0.0) |
25 | 109 | ret double %result |
26 | 110 | } |
27 | 111 |
|
| 112 | +define double @test_cosh_ln2() { |
| 113 | +; CHECK-LABEL: define double @test_cosh_ln2() { |
| 114 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x3FE62E42FEFA3BDC) |
| 115 | +; CHECK-NEXT: ret double [[RES]] |
| 116 | +; |
| 117 | + %res = call double @llvm.cosh.f64(double 0.69314718056) |
| 118 | + ret double %res |
| 119 | +} |
| 120 | + |
| 121 | +define double @test_cosh_ln5() { |
| 122 | +; CHECK-LABEL: define double @test_cosh_ln5() { |
| 123 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x3FF9C041F7ED4511) |
| 124 | +; CHECK-NEXT: ret double [[RES]] |
| 125 | +; |
| 126 | + %res = call double @llvm.cosh.f64(double 1.60943791243) |
| 127 | + ret double %res |
| 128 | +} |
| 129 | + |
28 | 130 | define <2 x double> @test_cosh_v2() { |
29 | 131 | ; CHECK-LABEL: define <2 x double> @test_cosh_v2() { |
30 | | -; CHECK-NEXT: ret <2 x double> splat (double 1.000000e+00) |
| 132 | +; CHECK-NEXT: [[RESULT:%.*]] = call <2 x double> @llvm.cosh.v2f64(<2 x double> zeroinitializer) |
| 133 | +; CHECK-NEXT: ret <2 x double> [[RESULT]] |
31 | 134 | ; |
32 | 135 | %result = call <2 x double> @llvm.cosh.v2f64(<2 x double> zeroinitializer) |
33 | 136 | ret <2 x double> %result |
34 | 137 | } |
35 | 138 |
|
| 139 | +define double @test_cosh_neg0() { |
| 140 | +; CHECK-LABEL: define double @test_cosh_neg0() { |
| 141 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double -0.000000e+00) |
| 142 | +; CHECK-NEXT: ret double [[RES]] |
| 143 | +; |
| 144 | + %res = call double @llvm.cosh.f64(double -0.0) |
| 145 | + ret double %res |
| 146 | +} |
| 147 | + |
| 148 | +define double @test_cosh_poison() { |
| 149 | +; CHECK-LABEL: define double @test_cosh_poison() { |
| 150 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double poison) |
| 151 | +; CHECK-NEXT: ret double [[RES]] |
| 152 | +; |
| 153 | + %res = call double @llvm.cosh.f64(double poison) |
| 154 | + ret double %res |
| 155 | +} |
| 156 | + |
| 157 | +define double @test_cosh_undef() { |
| 158 | +; CHECK-LABEL: define double @test_cosh_undef() { |
| 159 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double undef) |
| 160 | +; CHECK-NEXT: ret double [[RES]] |
| 161 | +; |
| 162 | + %res = call double @llvm.cosh.f64(double undef) |
| 163 | + ret double %res |
| 164 | +} |
36 | 165 |
|
| 166 | +define double @test_cosh_snan() { |
| 167 | +; CHECK-LABEL: define double @test_cosh_snan() { |
| 168 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x7FF0000000000001) |
| 169 | +; CHECK-NEXT: ret double [[RES]] |
| 170 | +; |
| 171 | + %res = call double @llvm.cosh.f64(double 0x7ff0000000000001) |
| 172 | + ret double %res |
| 173 | +} |
| 174 | + |
| 175 | +define double @test_cosh_qnan() { |
| 176 | +; CHECK-LABEL: define double @test_cosh_qnan() { |
| 177 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x7FF8000000000000) |
| 178 | +; CHECK-NEXT: ret double [[RES]] |
| 179 | +; |
| 180 | + %res = call double @llvm.cosh.f64(double 0x7ff8000000000000) |
| 181 | + ret double %res |
| 182 | +} |
| 183 | + |
| 184 | +define double @test_cosh_pos_inf() { |
| 185 | +; CHECK-LABEL: define double @test_cosh_pos_inf() { |
| 186 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0x7FF0000000000000) |
| 187 | +; CHECK-NEXT: ret double [[RES]] |
| 188 | +; |
| 189 | + %res = call double @llvm.cosh.f64(double 0x7ff0000000000000) |
| 190 | + ret double %res |
| 191 | +} |
| 192 | + |
| 193 | +define double @test_cosh_neg_inf() { |
| 194 | +; CHECK-LABEL: define double @test_cosh_neg_inf() { |
| 195 | +; CHECK-NEXT: [[RES:%.*]] = call double @llvm.cosh.f64(double 0xFFF0000000000000) |
| 196 | +; CHECK-NEXT: ret double [[RES]] |
| 197 | +; |
| 198 | + %res = call double @llvm.cosh.f64(double 0xfff0000000000000) |
| 199 | + ret double %res |
| 200 | +} |
0 commit comments