forked from OSchip/llvm-project
[NFC][FPEnv] Pre-commit tests for canonicalize negated operand of fdiv.
llvm-svn: 367233
This commit is contained in:
parent
5ab948f823
commit
b32a6592eb
|
@ -510,6 +510,17 @@ define double @fdiv_fneg1(double %x, double %y) {
|
|||
ret double %div
|
||||
}
|
||||
|
||||
define double @fdiv_unary_fneg1(double %x, double %y) {
|
||||
; CHECK-LABEL: @fdiv_unary_fneg1(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fdiv double [[X:%.*]], [[Y:%.*]]
|
||||
; CHECK-NEXT: [[DIV:%.*]] = fsub double -0.000000e+00, [[TMP1]]
|
||||
; CHECK-NEXT: ret double [[DIV]]
|
||||
;
|
||||
%neg = fneg double %x
|
||||
%div = fdiv double %neg, %y
|
||||
ret double %div
|
||||
}
|
||||
|
||||
define <2 x float> @fdiv_fneg2(<2 x float> %x, <2 x float> %y) {
|
||||
; CHECK-LABEL: @fdiv_fneg2(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fdiv <2 x float> [[Y:%.*]], [[X:%.*]]
|
||||
|
@ -521,6 +532,17 @@ define <2 x float> @fdiv_fneg2(<2 x float> %x, <2 x float> %y) {
|
|||
ret <2 x float> %div
|
||||
}
|
||||
|
||||
define <2 x float> @fdiv_unary_fneg2(<2 x float> %x, <2 x float> %y) {
|
||||
; CHECK-LABEL: @fdiv_unary_fneg2(
|
||||
; CHECK-NEXT: [[TMP1:%.*]] = fdiv <2 x float> [[Y:%.*]], [[X:%.*]]
|
||||
; CHECK-NEXT: [[DIV:%.*]] = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, [[TMP1]]
|
||||
; CHECK-NEXT: ret <2 x float> [[DIV]]
|
||||
;
|
||||
%neg = fneg <2 x float> %x
|
||||
%div = fdiv <2 x float> %y, %neg
|
||||
ret <2 x float> %div
|
||||
}
|
||||
|
||||
define float @fdiv_fneg1_extra_use(float %x, float %y) {
|
||||
; CHECK-LABEL: @fdiv_fneg1_extra_use(
|
||||
; CHECK-NEXT: [[NEG:%.*]] = fsub float -0.000000e+00, [[X:%.*]]
|
||||
|
|
Loading…
Reference in New Issue