This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [9/n] PR85694: Add a vect_look_through_pattern helper
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 Jun 2018 11:24:07 +0100
- Subject: Re: [9/n] PR85694: Add a vect_look_through_pattern helper
- References: <87d0wof858.fsf@arm.com> <CAFiYyc3XUhYnFU7uiJeMbkyetZYm9PjM7rDpZz_wALO=aNq_gQ@mail.gmail.com>
Richard Biener <richard.guenther@gmail.com> writes:
> On Mon, Jun 18, 2018 at 5:04 PM Richard Sandiford
> <richard.sandiford@arm.com> wrote:
>>
>> When following the definitions of SSA names, some recognisers
>> already cope with statements that have been replaced by patterns.
>> This patch makes that happen automatically for users of
>> type_conversion_p and vect_get_internal_def. It also adds
>> a vect_look_through_pattern helper that can be used directly.
>>
>> The reason for doing this is that the main patch for PR85694
>> makes over_widening handle more general cases. These over-widened
>> patterns can still be useful when matching later statements;
>> e.g. an overwidened MULT_EXPR could be the input to a DOT_PROD_EXPR.
>>
>> The patch doesn't do anything with the STMT_VINFO_IN_PATTERN_P checks
>> in vect_recog_over_widening_pattern or vect_recog_widen_shift_pattern
>> since later patches rewrite them anyway.
>>
>> Doing this fixed an XFAIL in vect-reduc-dot-u16b.c.
>>
>> Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install?
>
> Hmm. It seems to me that *def_stmt for vect_is_simple_use should
> eventually be the pattern def given the vectype overload takes the
> vectype from the pattern def already but oddly enough the
> DEF_TYPE is taken from the non-pattern stmt.
>
> I wonder which callers look at def_stmt at all (and how...)
>
> I guess swapping the def_stmt and dt arguments and adding yet another
> overload to remove all unused &def_stmt args might this easier to review...
>
> So - I'm suggesting to change vect_is_simple_use.
OK, I'll try that. Might end up being its own mini-series. :-)
I'll post the next set of patches anyway since they don't depend
on *how* this is fixed, just that it is.
Thanks,
Richard