private:
bool matchIfFNeg(Value *LHS, Value *RHS) {
- if (const auto *C = dyn_cast<ConstantFP>(LHS))
+ if (const auto *C = dyn_cast<Constant>(LHS))
return C->isNegativeZeroValue() && L.match(RHS);
return false;
}
ret float %cos
}
-; FIXME: m_FNeg() doesn't handle vectors
-
define <2 x float> @fneg_v2f32(<2 x float> %x) {
; CHECK-LABEL: @fneg_v2f32(
-; CHECK-NEXT: [[X_FNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[X:%.*]]
-; CHECK-NEXT: [[COS:%.*]] = call <2 x float> @llvm.cos.v2f32(<2 x float> [[X_FNEG]])
+; CHECK-NEXT: [[COS:%.*]] = call <2 x float> @llvm.cos.v2f32(<2 x float> [[X:%.*]])
; CHECK-NEXT: ret <2 x float> [[COS]]
;
%x.fneg = fsub <2 x float> <float -0.0, float -0.0>, %x
define <2 x float> @fabs_fneg_v2f32(<2 x float> %x) {
; CHECK-LABEL: @fabs_fneg_v2f32(
-; CHECK-NEXT: [[X_FABS:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[X:%.*]])
-; CHECK-NEXT: [[X_FABS_FNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[X_FABS]]
-; CHECK-NEXT: [[COS:%.*]] = call <2 x float> @llvm.cos.v2f32(<2 x float> [[X_FABS_FNEG]])
+; CHECK-NEXT: [[COS:%.*]] = call <2 x float> @llvm.cos.v2f32(<2 x float> [[X:%.*]])
; CHECK-NEXT: ret <2 x float> [[COS]]
;
%x.fabs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %x)
define <2 x float> @fneg_fneg_vec(<2 x float> %x, <2 x float> %y) {
; CHECK-LABEL: @fneg_fneg_vec(
-; CHECK-NEXT: [[XNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[X:%.*]]
-; CHECK-NEXT: [[YNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[Y:%.*]]
-; CHECK-NEXT: [[DIV:%.*]] = fdiv <2 x float> [[XNEG]], [[YNEG]]
+; CHECK-NEXT: [[DIV:%.*]] = fdiv <2 x float> [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: ret <2 x float> [[DIV]]
;
%xneg = fsub <2 x float> <float -0.0, float -0.0>, %x