Handle IFN_COND_MUL in tree-ssa-math-opts.c
This patch extends the FMA handling in tree-ssa-math-opts.c so
that it can cope with conditional multiplications as well as
unconditional multiplications. The addition or subtraction must then
have the same condition as the multiplication (at least for now).
E.g. we can currently fold:
(IFN_COND_ADD cond (mul x y) z fallback)
-> (IFN_COND_FMA cond x y z fallback)
This patch also allows:
(IFN_COND_ADD cond (IFN_COND_MUL cond x y <whatever>) z fallback)
-> (IFN_COND_FMA cond x y z fallback)
2019-07-30 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-ssa-math-opts.c (convert_mult_to_fma): Add a mul_cond
parameter. When nonnull, make sure that the addition or subtraction
has the same condition.
(math_opts_dom_walker::after_dom_children): Try convert_mult_to_fma
for CFN_COND_MUL too.
gcc/testsuite/
* gcc.dg/vect/vect-cond-arith-7.c: New test.
From-SVN: r273905