public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ira Rosen <ira.rosen@linaro.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gcc-patches@gcc.gnu.org, Patch Tracking <patches@linaro.org>
Subject: Re: [patch] Fix PR tree-optimization/49771
Date: Sun, 24 Jul 2011 14:32:00 -0000	[thread overview]
Message-ID: <CAKSNEw5zPPBn9+J9YO0fqmhYXmSVJr66AyT2kWipwR33BDyfZA@mail.gmail.com> (raw)
In-Reply-To: <CAKSNEw6E3fE9_z9hfV1NSHWn8Dvjg2ind8J0-dU33UW8gBxQ5A@mail.gmail.com>

On 21 July 2011 15:19, Ira Rosen <ira.rosen@linaro.org> wrote:
> On 20 July 2011 21:35, Ulrich Weigand <uweigand@de.ibm.com> wrote:
>>
>> The return value of foo with vectorization is 1249 instead
>> of 1999 for some reason.
>
> I reproduced the failure. It occurs without Richard's
> (http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01022.html) and this
> patches too. Obviously the vectorized loop is executed, but at the
> moment I don't understand why. I'll have a better look on Sunday.

Actually it doesn't choose the vectorized code. But the scalar version
gets optimized in a harmful way for SPU, AFAIU.
Here is the scalar loop after vrp2

<bb 8>:
  # ivtmp.42_50 = PHI <ivtmp.42_59(3), ivtmp.42_45(10)>
  D.4593_42 = (void *) ivtmp.53_32;
  D.4520_33 = MEM[base: D.4593_42, offset: 0B];
  D.4521_34 = D.4520_33 + 1;
  MEM[symbol: a, index: ivtmp.42_50, offset: 0B] = D.4521_34;
  ivtmp.42_45 = ivtmp.42_50 + 4;
  if (ivtmp.42_45 != 16)
    goto <bb 10>;
  else
    goto <bb 5>;

and the load is changed by dom2 to:

<bb 4>:
  ...
  D.4520_33 = MEM[base: vect_pa.9_19, offset: 0B];
   ...

where vector(4) int * vect_pa.9;

And the scalar loop has no rotate for that load:

.L3:
        lqd     $13,0($2)
        lqx     $11,$5,$3
        cwx     $7,$sp,$3
        ai      $12,$13,1
        shufb   $6,$12,$11,$7
        stqx    $6,$5,$3
        ai      $3,$3,4
        ceqi    $4,$3,16


I manually added rotqby for $13 and the result was correct (I changed
the test to iterate only 4 times to make the things easier).

Ira

>
> Ira
>
>>
>> Bye,
>> Ulrich
>>
>> --
>>  Dr. Ulrich Weigand
>>  GNU Toolchain for Linux on System z and Cell BE
>>  Ulrich.Weigand@de.ibm.com
>>
>

  reply	other threads:[~2011-07-24 12:02 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19  8:24 Ira Rosen
2011-07-19  9:49 ` Richard Guenther
2011-07-19 14:01   ` Ira Rosen
2011-07-19 14:03     ` Richard Guenther
2011-07-20 19:47 ` Ulrich Weigand
2011-07-21 12:54   ` Ira Rosen
2011-07-24 14:32     ` Ira Rosen [this message]
2011-07-24 18:46       ` Richard Guenther
2011-07-25  9:44         ` Ulrich Weigand
2011-07-25 10:08           ` Richard Guenther
2011-07-25 11:26             ` Ira Rosen
2011-07-25 11:41               ` Richard Guenther
2011-07-25 12:33                 ` Ira Rosen
2011-07-25 13:01                   ` Richard Guenther
2011-07-25 13:07                     ` Richard Guenther
2011-07-25 13:47                       ` Ulrich Weigand
2011-07-25 14:01                         ` Richard Guenther
2011-07-25 14:10                           ` Richard Guenther
2011-07-25 14:14                             ` Richard Guenther
2011-07-25 14:54                               ` Ulrich Weigand
2011-07-25 14:59                                 ` Richard Guenther
2011-07-25 16:12                                   ` Ulrich Weigand
2011-07-26  8:25                                     ` Richard Guenther
2011-07-26  8:59                                       ` Andrew Pinski
2011-07-26 14:23                                       ` Ulrich Weigand
2011-07-26 14:25                                         ` Michael Matz
2011-07-26 16:18                                           ` Merge alignments from coalesced SSA pointers Michael Matz
2011-07-26 17:23                                             ` Michael Matz
2011-08-08 16:34                                               ` Ulrich Weigand
2011-08-09 12:01                                                 ` Michael Matz
2011-08-12 16:41                                                   ` [rfa] Set alignment of pseudos via get_pointer_alignment Michael Matz
2011-08-12 22:53                                                     ` Richard Guenther
2011-08-23 15:04                                                       ` Michael Matz
2011-07-26 17:28                                             ` Merge alignments from coalesced SSA pointers Ulrich Weigand
2011-07-27  9:13                                               ` Richard Guenther

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=CAKSNEw5zPPBn9+J9YO0fqmhYXmSVJr66AyT2kWipwR33BDyfZA@mail.gmail.com \
    --to=ira.rosen@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=patches@linaro.org \
    --cc=uweigand@de.ibm.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).