[PATCH] tree-ssa-mathopts: Use proper poly_int64 comparison with param_avoid_fma_max_bits [PR 98766]

Kyrylo Tkachov Kyrylo.Tkachov@arm.com
Fri Jan 22 16:41:30 GMT 2021


Hi Richard,

> -----Original Message-----
> From: Richard Sandiford <richard.sandiford@arm.com>
> Sent: 22 January 2021 13:09
> To: Kyrylo Tkachov via Gcc-patches <gcc-patches@gcc.gnu.org>
> Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>
> Subject: Re: [PATCH] tree-ssa-mathopts: Use proper poly_int64 comparison
> with param_avoid_fma_max_bits [PR 98766]
> 
> Kyrylo Tkachov via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> > diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
> > index
> d6201d3cb943e145720c18fbf3aadd853fd87b44..800815b855c759075b4326
> 361cc4db7183f1c543 100644
> > --- a/gcc/tree-ssa-math-opts.c
> > +++ b/gcc/tree-ssa-math-opts.c
> > @@ -3252,8 +3252,8 @@ convert_mult_to_fma (gimple *mul_stmt, tree
> op1, tree op2,
> >
> >    bool check_defer
> >      = (state->m_deferring_p
> > -       && (tree_to_shwi (TYPE_SIZE (type))
> > -	   <= param_avoid_fma_max_bits));
> > +       && known_le (tree_to_poly_int64 (TYPE_SIZE (type)),
> > +		    param_avoid_fma_max_bits));
> 
> I'd suggest maybe_le here instead.  I.e. instead of the current
> “don't do this if the vector length is X” have “don't do this if
> the vector length might be X”.
> 
> OK from my point of view with that change.

Thanks.
Pushed with that change after a bootstrap and test on aarch64-none-linux-gnu.
Kyrill

> 
> Thanks,
> Richard
> 
> >    bool defer = check_defer;
> >    bool seen_negate_p = false;
> >    /* Make sure that the multiplication statement becomes dead after
-------------- next part --------------
A non-text attachment was scrubbed...
Name: math-opts.patch
Type: application/octet-stream
Size: 1212 bytes
Desc: math-opts.patch
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210122/7db49009/attachment-0001.obj>


More information about the Gcc-patches mailing list