public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ira Rosen <ira.rosen@linaro.org>
To: Richard Guenther <richard.guenther@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Patch Tracking <patches@linaro.org>
Subject: Re: [patch] Fix PR tree-optimization/49318
Date: Fri, 10 Jun 2011 11:37:00 -0000	[thread overview]
Message-ID: <BANLkTi=KkDj8opRqigzgWBVC8KedgbvwhA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinExCpe5ySseNuFXq-dK7H=ipR0bQ@mail.gmail.com>

On 10 June 2011 12:14, Richard Guenther <richard.guenther@gmail.com> wrote:
> On Fri, Jun 10, 2011 at 9:19 AM, Ira Rosen <ira.rosen@linaro.org> wrote:
>> Hi,
>>
>> The test in PR 49318 fails because the vectorizer recognizes address
>> computation sequence as a widening-multiplication pattern, while such
>> sequence is not relevant to vectorization. The problem is that the
>> vectorizer doesn't check if a statement is going to be vectorized
>> before replacing it with a pattern. Moreover, the vectorizer first
>> detects the patterns and only after that looks for relevant
>> statements. Changing the order is not a good option, since statements
>> relevance is defined also by their belonging to a pattern.
>>
>> This patch solves the problem by removing pattern statements that were
>> created for statements that are not supposed to be vectorized.
>>
>> Bootstrapped with vectorization enabled on powerpc64-suse-linux and
>> tested on powerpc64-suse-linux and x86_64-suse-linux.
>> Committed.
>
> Ick, yeah.  I remember running into this ordering issue when doing the
> multi-vector size reorgs...
>
> In the end I think we should not generate the pattern stmt during
> pattern matching but only mark the relevant statements with a
> pattern kind.  Say, for each pattern we have a "main" statement
> that has related stmts belonging to the pattern that define uses
> of the "main" statement - mark those to refer to that "main" statement.
> For that "main" statement simply record an enum value, like,
> widening_mult.  Then only at vectorized statement
> generation time actually generate the vectorized form of the
> pattern statement.
>
> Thus, the non-vectorized pattern statements would never be generated.
>
> So, separate analysis and transform more properly.
>
> Of course I didn't get around to implement the above ... (we'd have
> a new vectorizable_pattern worker).

Sounds like a good idea. I'll give it a try.

Thanks,
Ira

>
> Richard.
>
>> Ira
>>
>> ChangeLog:
>>
>>     PR tree-optimization/49318
>>     * tree-vect-loop.c (vect_determine_vectorization_factor):
>>     Remove irrelevant pattern statements.
>>
>> testsuite/ChangeLog:
>>
>>     PR tree-optimization/49318
>>     * gcc.dg/vect/pr49318.c: New test.
>>
>

      reply	other threads:[~2011-06-10 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-10  8:36 Ira Rosen
2011-06-10  9:23 ` Richard Guenther
2011-06-10 11:37   ` Ira Rosen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTi=KkDj8opRqigzgWBVC8KedgbvwhA@mail.gmail.com' \
    --to=ira.rosen@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patches@linaro.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).