|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3 |
| 2 | +; RUN: opt -S -passes=instsimplify %s | FileCheck %s |
| 3 | + |
| 4 | +define { float, float } @sincos_zero() { |
| 5 | +; CHECK-LABEL: define { float, float } @sincos_zero() { |
| 6 | +; CHECK-NEXT: ret { float, float } { float 0.000000e+00, float 1.000000e+00 } |
| 7 | +; |
| 8 | + %ret = call { float, float } @llvm.sincos.f32(float zeroinitializer) |
| 9 | + ret { float, float } %ret |
| 10 | +} |
| 11 | + |
| 12 | +define { float, float } @sincos_neg_zero() { |
| 13 | +; CHECK-LABEL: define { float, float } @sincos_neg_zero() { |
| 14 | +; CHECK-NEXT: ret { float, float } { float -0.000000e+00, float 1.000000e+00 } |
| 15 | +; |
| 16 | + %ret = call { float, float } @llvm.sincos.f32(float -0.0) |
| 17 | + ret { float, float } %ret |
| 18 | +} |
| 19 | + |
| 20 | +define { <2 x float>, <2 x float> } @sincos_zero_vector() { |
| 21 | +; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_zero_vector() { |
| 22 | +; CHECK-NEXT: ret { <2 x float>, <2 x float> } { <2 x float> zeroinitializer, <2 x float> <float 1.000000e+00, float 1.000000e+00> } |
| 23 | +; |
| 24 | + %ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> zeroinitializer) |
| 25 | + ret { <2 x float>, <2 x float> } %ret |
| 26 | +} |
| 27 | + |
| 28 | +define { float, float } @sincos_poison() { |
| 29 | +; CHECK-LABEL: define { float, float } @sincos_poison() { |
| 30 | +; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float poison) |
| 31 | +; CHECK-NEXT: ret { float, float } [[RET]] |
| 32 | +; |
| 33 | + %ret = call { float, float } @llvm.sincos.f32(float poison) |
| 34 | + ret { float, float } %ret |
| 35 | +} |
| 36 | + |
| 37 | +define { <2 x float>, <2 x float> } @sincos_poison_vector() { |
| 38 | +; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_poison_vector() { |
| 39 | +; CHECK-NEXT: [[RET:%.*]] = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> poison) |
| 40 | +; CHECK-NEXT: ret { <2 x float>, <2 x float> } [[RET]] |
| 41 | +; |
| 42 | + %ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> poison) |
| 43 | + ret { <2 x float>, <2 x float> } %ret |
| 44 | +} |
| 45 | + |
| 46 | +define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_poison_scalable_vector() { |
| 47 | +; CHECK-LABEL: define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_poison_scalable_vector() { |
| 48 | +; CHECK-NEXT: [[RET:%.*]] = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> poison) |
| 49 | +; CHECK-NEXT: ret { <vscale x 2 x float>, <vscale x 2 x float> } [[RET]] |
| 50 | +; |
| 51 | + %ret = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> poison) |
| 52 | + ret { <vscale x 2 x float>, <vscale x 2 x float> } %ret |
| 53 | +} |
| 54 | + |
| 55 | +define { float, float } @sincos_undef() { |
| 56 | +; CHECK-LABEL: define { float, float } @sincos_undef() { |
| 57 | +; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float undef) |
| 58 | +; CHECK-NEXT: ret { float, float } [[RET]] |
| 59 | +; |
| 60 | + %ret = call { float, float } @llvm.sincos.f32(float undef) |
| 61 | + ret { float, float } %ret |
| 62 | +} |
| 63 | + |
| 64 | +define { <2 x float>, <2 x float> } @sincos_undef_vector() { |
| 65 | +; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_undef_vector() { |
| 66 | +; CHECK-NEXT: [[RET:%.*]] = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> undef) |
| 67 | +; CHECK-NEXT: ret { <2 x float>, <2 x float> } [[RET]] |
| 68 | +; |
| 69 | + %ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> undef) |
| 70 | + ret { <2 x float>, <2 x float> } %ret |
| 71 | +} |
| 72 | + |
| 73 | +define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_undef_scalable_vector() { |
| 74 | +; CHECK-LABEL: define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_undef_scalable_vector() { |
| 75 | +; CHECK-NEXT: [[RET:%.*]] = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> undef) |
| 76 | +; CHECK-NEXT: ret { <vscale x 2 x float>, <vscale x 2 x float> } [[RET]] |
| 77 | +; |
| 78 | + %ret = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> undef) |
| 79 | + ret { <vscale x 2 x float>, <vscale x 2 x float> } %ret |
| 80 | +} |
| 81 | + |
| 82 | +define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_zero_scalable_vector() { |
| 83 | +; CHECK-LABEL: define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_zero_scalable_vector() { |
| 84 | +; CHECK-NEXT: [[RET:%.*]] = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> zeroinitializer) |
| 85 | +; CHECK-NEXT: ret { <vscale x 2 x float>, <vscale x 2 x float> } [[RET]] |
| 86 | +; |
| 87 | + %ret = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> zeroinitializer) |
| 88 | + ret { <vscale x 2 x float>, <vscale x 2 x float> } %ret |
| 89 | +} |
| 90 | + |
| 91 | +define { float, float } @sincos_inf() { |
| 92 | +; CHECK-LABEL: define { float, float } @sincos_inf() { |
| 93 | +; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0x7FF0000000000000) |
| 94 | +; CHECK-NEXT: ret { float, float } [[RET]] |
| 95 | +; |
| 96 | + %ret = call { float, float } @llvm.sincos.f32(float 0x7FF0000000000000) |
| 97 | + ret { float, float } %ret |
| 98 | +} |
| 99 | + |
| 100 | +define { float, float } @sincos_neginf() { |
| 101 | +; CHECK-LABEL: define { float, float } @sincos_neginf() { |
| 102 | +; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0xFFF0000000000000) |
| 103 | +; CHECK-NEXT: ret { float, float } [[RET]] |
| 104 | +; |
| 105 | + %ret = call { float, float } @llvm.sincos.f32(float 0xFFF0000000000000) |
| 106 | + ret { float, float } %ret |
| 107 | +} |
| 108 | + |
| 109 | +define { float, float } @sincos_qnam() { |
| 110 | +; CHECK-LABEL: define { float, float } @sincos_qnam() { |
| 111 | +; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0x7FF8000000000000) |
| 112 | +; CHECK-NEXT: ret { float, float } [[RET]] |
| 113 | +; |
| 114 | + %ret = call { float, float } @llvm.sincos.f32(float 0x7FF8000000000000) |
| 115 | + ret { float, float } %ret |
| 116 | +} |
| 117 | + |
| 118 | +define { float, float } @sincos_snam() { |
| 119 | +; CHECK-LABEL: define { float, float } @sincos_snam() { |
| 120 | +; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0x7FF0000020000000) |
| 121 | +; CHECK-NEXT: ret { float, float } [[RET]] |
| 122 | +; |
| 123 | + %ret = call { float, float } @llvm.sincos.f32(float bitcast (i32 2139095041 to float)) |
| 124 | + ret { float, float } %ret |
| 125 | +} |
0 commit comments