[SVE] [fwprop] PR88833 - Redundant moves for WHILELO-based loops

Prathamesh Kulkarni prathamesh.kulkarni@linaro.org
Tue Jul 2 12:10:00 GMT 2019


On Tue, 2 Jul 2019 at 16:59, Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> Thanks for fixing this.
>
> Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> writes:
> > diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
> > index 89a46a933fa..79bd0cfbd28 100644
> > --- a/gcc/simplify-rtx.c
> > +++ b/gcc/simplify-rtx.c
> > @@ -6697,6 +6697,19 @@ simplify_subreg (machine_mode outermode, rtx op,
> >       }
> >      }
> >
> > +  /* If op is a vector comparison operator, rewrite it in a new mode.
> > +     This probably won't match, but may allow further simplifications.
> > +     Also check if number of elements and size of each element
> > +     match for outermode and innermode.  */
> > +
>
> Excess blank line after the comment.  IMO the second part of the comment
> reads too much like an afterthought.  How about:
>
>   /* If OP is a vector comparison and the subreg is not changing the
>      number of elements or the size of the elements, change the result
>      of the comparison to the new mode.  */
>
> > +  if (COMPARISON_P (op)
> > +      && VECTOR_MODE_P (outermode)
> > +      && VECTOR_MODE_P (innermode)
> > +      && (known_eq (GET_MODE_NUNITS (outermode), GET_MODE_NUNITS (innermode)))
> > +      && (known_eq (GET_MODE_UNIT_SIZE (outermode),
> > +                 GET_MODE_UNIT_SIZE (innermode))))
>
> Redundant brackets around the known_eq calls.
>
> > +    return gen_rtx_fmt_ee (GET_CODE (op), outermode, XEXP (op, 0), XEXP (op, 1));
>
> This should use simplify_gen_relational, so that we try to simplify
> the new expression.
Does the attached version look OK ?

Thanks,
Prathamesh
>
> Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88833-12.diff
Type: text/x-patch
Size: 7073 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190702/5a1dab33/attachment.bin>


More information about the Gcc-patches mailing list