1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
; RUN: opt -S -passes=instsimplify %s | FileCheck %s
define { float, float } @sincos_zero() {
; CHECK-LABEL: define { float, float } @sincos_zero() {
; CHECK-NEXT: ret { float, float } { float 0.000000e+00, float 1.000000e+00 }
;
%ret = call { float, float } @llvm.sincos.f32(float zeroinitializer)
ret { float, float } %ret
}
define { float, float } @sincos_neg_zero() {
; CHECK-LABEL: define { float, float } @sincos_neg_zero() {
; CHECK-NEXT: ret { float, float } { float -0.000000e+00, float 1.000000e+00 }
;
%ret = call { float, float } @llvm.sincos.f32(float -0.0)
ret { float, float } %ret
}
define { float, float } @sincos_one() {
; CHECK-LABEL: define { float, float } @sincos_one() {
; CHECK-NEXT: ret { float, float } { float [[$SIN_ONE:.+]], float [[$COS_ONE:.+]] }
;
%ret = call { float, float } @llvm.sincos.f32(float 1.0)
ret { float, float } %ret
}
define { float, float } @sincos_two() {
; CHECK-LABEL: define { float, float } @sincos_two() {
; CHECK-NEXT: ret { float, float } { float [[$SIN_TWO:.+]], float [[$COS_TWO:.+]] }
;
%ret = call { float, float } @llvm.sincos.f32(float 2.0)
ret { float, float } %ret
}
define { <2 x float>, <2 x float> } @sincos_vector() {
; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_vector() {
; CHECK-NEXT: ret { <2 x float>, <2 x float> } { <2 x float> <float [[$SIN_ONE]], float [[$SIN_TWO]]>, <2 x float> <float [[$COS_ONE]], float [[$COS_TWO]]> }
;
%ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> <float 1.0, float 2.0>)
ret { <2 x float>, <2 x float> } %ret
}
define { <2 x float>, <2 x float> } @sincos_zero_vector() {
; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_zero_vector() {
; CHECK-NEXT: ret { <2 x float>, <2 x float> } { <2 x float> zeroinitializer, <2 x float> splat (float 1.000000e+00) }
;
%ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> zeroinitializer)
ret { <2 x float>, <2 x float> } %ret
}
define { float, float } @sincos_poison() {
; CHECK-LABEL: define { float, float } @sincos_poison() {
; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float poison)
; CHECK-NEXT: ret { float, float } [[RET]]
;
%ret = call { float, float } @llvm.sincos.f32(float poison)
ret { float, float } %ret
}
define { <2 x float>, <2 x float> } @sincos_poison_vector() {
; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_poison_vector() {
; CHECK-NEXT: [[RET:%.*]] = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> poison)
; CHECK-NEXT: ret { <2 x float>, <2 x float> } [[RET]]
;
%ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> poison)
ret { <2 x float>, <2 x float> } %ret
}
define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_poison_scalable_vector() {
; CHECK-LABEL: define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_poison_scalable_vector() {
; CHECK-NEXT: [[RET:%.*]] = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> poison)
; CHECK-NEXT: ret { <vscale x 2 x float>, <vscale x 2 x float> } [[RET]]
;
%ret = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> poison)
ret { <vscale x 2 x float>, <vscale x 2 x float> } %ret
}
define { float, float } @sincos_undef() {
; CHECK-LABEL: define { float, float } @sincos_undef() {
; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float undef)
; CHECK-NEXT: ret { float, float } [[RET]]
;
%ret = call { float, float } @llvm.sincos.f32(float undef)
ret { float, float } %ret
}
define { <2 x float>, <2 x float> } @sincos_undef_vector() {
; CHECK-LABEL: define { <2 x float>, <2 x float> } @sincos_undef_vector() {
; CHECK-NEXT: [[RET:%.*]] = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> undef)
; CHECK-NEXT: ret { <2 x float>, <2 x float> } [[RET]]
;
%ret = call { <2 x float>, <2 x float> } @llvm.sincos.v2f32(<2 x float> undef)
ret { <2 x float>, <2 x float> } %ret
}
define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_undef_scalable_vector() {
; CHECK-LABEL: define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_undef_scalable_vector() {
; CHECK-NEXT: [[RET:%.*]] = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> undef)
; CHECK-NEXT: ret { <vscale x 2 x float>, <vscale x 2 x float> } [[RET]]
;
%ret = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> undef)
ret { <vscale x 2 x float>, <vscale x 2 x float> } %ret
}
define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_zero_scalable_vector() {
; CHECK-LABEL: define { <vscale x 2 x float>, <vscale x 2 x float> } @sincos_zero_scalable_vector() {
; CHECK-NEXT: [[RET:%.*]] = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> zeroinitializer)
; CHECK-NEXT: ret { <vscale x 2 x float>, <vscale x 2 x float> } [[RET]]
;
%ret = call { <vscale x 2 x float>, <vscale x 2 x float> } @llvm.sincos.nxv2f32(<vscale x 2 x float> zeroinitializer)
ret { <vscale x 2 x float>, <vscale x 2 x float> } %ret
}
define { float, float } @sincos_inf() {
; CHECK-LABEL: define { float, float } @sincos_inf() {
; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0x7FF0000000000000)
; CHECK-NEXT: ret { float, float } [[RET]]
;
%ret = call { float, float } @llvm.sincos.f32(float 0x7FF0000000000000)
ret { float, float } %ret
}
define { float, float } @sincos_neginf() {
; CHECK-LABEL: define { float, float } @sincos_neginf() {
; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0xFFF0000000000000)
; CHECK-NEXT: ret { float, float } [[RET]]
;
%ret = call { float, float } @llvm.sincos.f32(float 0xFFF0000000000000)
ret { float, float } %ret
}
define { float, float } @sincos_qnan() {
; CHECK-LABEL: define { float, float } @sincos_qnan() {
; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0x7FF8000000000000)
; CHECK-NEXT: ret { float, float } [[RET]]
;
%ret = call { float, float } @llvm.sincos.f32(float 0x7FF8000000000000)
ret { float, float } %ret
}
define { float, float } @sincos_snan() {
; CHECK-LABEL: define { float, float } @sincos_snan() {
; CHECK-NEXT: [[RET:%.*]] = call { float, float } @llvm.sincos.f32(float 0x7FF0000020000000)
; CHECK-NEXT: ret { float, float } [[RET]]
;
%ret = call { float, float } @llvm.sincos.f32(float bitcast (i32 2139095041 to float))
ret { float, float } %ret
}
|