diff options
Diffstat (limited to 'llvm/test/Transforms/InstCombine/fdiv.ll')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/fdiv.ll | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fdiv.ll b/llvm/test/Transforms/InstCombine/fdiv.ll index 8073371c16b..9e265d2135f 100644 --- a/llvm/test/Transforms/InstCombine/fdiv.ll +++ b/llvm/test/Transforms/InstCombine/fdiv.ll @@ -122,6 +122,15 @@ define <2 x float> @not_exact_inverse_vec_arcp(<2 x float> %x) { ret <2 x float> %div } +define <2 x float> @not_exact_inverse_vec_arcp_with_undef_elt(<2 x float> %x) { +; CHECK-LABEL: @not_exact_inverse_vec_arcp_with_undef_elt( +; CHECK-NEXT: [[DIV:%.*]] = fdiv arcp <2 x float> [[X:%.*]], <float undef, float 3.000000e+00> +; CHECK-NEXT: ret <2 x float> [[DIV]] +; + %div = fdiv arcp <2 x float> %x, <float undef, float 3.0> + ret <2 x float> %div +} + ; (X / Y) / Z --> X / (Y * Z) define float @div_with_div_numerator(float %x, float %y, float %z) { @@ -213,6 +222,19 @@ define <2 x float> @fneg_fneg_vec(<2 x float> %x, <2 x float> %y) { ret <2 x float> %div } +define <2 x float> @fneg_fneg_vec_undef_elts(<2 x float> %x, <2 x float> %y) { +; CHECK-LABEL: @fneg_fneg_vec_undef_elts( +; CHECK-NEXT: [[XNEG:%.*]] = fsub <2 x float> <float undef, float -0.000000e+00>, [[X:%.*]] +; CHECK-NEXT: [[YNEG:%.*]] = fsub <2 x float> <float -0.000000e+00, float undef>, [[Y:%.*]] +; CHECK-NEXT: [[DIV:%.*]] = fdiv <2 x float> [[XNEG]], [[YNEG]] +; CHECK-NEXT: ret <2 x float> [[DIV]] +; + %xneg = fsub <2 x float> <float undef, float -0.0>, %x + %yneg = fsub <2 x float> <float -0.0, float undef>, %y + %div = fdiv <2 x float> %xneg, %yneg + ret <2 x float> %div +} + define float @fneg_dividend_constant_divisor(float %x) { ; CHECK-LABEL: @fneg_dividend_constant_divisor( ; CHECK-NEXT: [[DIV:%.*]] = fdiv nsz float [[X:%.*]], -3.000000e+00 @@ -243,6 +265,17 @@ define <2 x float> @fneg_dividend_constant_divisor_vec(<2 x float> %x) { ret <2 x float> %div } +define <2 x float> @fneg_dividend_constant_divisor_vec_undef_elt(<2 x float> %x) { +; CHECK-LABEL: @fneg_dividend_constant_divisor_vec_undef_elt( +; CHECK-NEXT: [[NEG:%.*]] = fsub <2 x float> <float undef, float -0.000000e+00>, [[X:%.*]] +; CHECK-NEXT: [[DIV:%.*]] = fdiv ninf <2 x float> [[NEG]], <float 3.000000e+00, float -8.000000e+00> +; CHECK-NEXT: ret <2 x float> [[DIV]] +; + %neg = fsub <2 x float> <float undef, float -0.0>, %x + %div = fdiv ninf <2 x float> %neg, <float 3.0, float -8.0> + ret <2 x float> %div +} + define <2 x float> @fneg_divisor_constant_dividend_vec(<2 x float> %x) { ; CHECK-LABEL: @fneg_divisor_constant_dividend_vec( ; CHECK-NEXT: [[DIV:%.*]] = fdiv afn <2 x float> <float 3.000000e+00, float -5.000000e+00>, [[X:%.*]] |

