public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/63175] [4.9/5 regression] FAIL: gcc.dg/vect/costmodel/ppc/costmodel-bb-slp-9a.c scan-tree-dump-times slp2" basic block vectorized using SLP" 1
Date: Thu, 26 Feb 2015 10:19:00 -0000	[thread overview]
Message-ID: <bug-63175-4-goXUh8Px1j@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63175-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63175

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looking at the original description - note that copying cannot be optimized
away, the accesses are to global variables (well, unless you build with -flto
or -fwhole-program which will privatize the stmts).

But of course the "correctness" test is optimized away very early.  So the
testcase should get a __asm__ volatile ("" : : "memory"); inbetween the
copying and the correctness verification.

Currently vectorization is entered with the IL

  <bb 2>:
  _8 = MEM[(unsigned int *)&in + 4B];
  MEM[(unsigned int *)&out] = _8;
  _14 = MEM[(unsigned int *)&in + 8B];
  MEM[(unsigned int *)&out + 4B] = _14;
  _20 = MEM[(unsigned int *)&in + 12B];
  MEM[(unsigned int *)&out + 8B] = _20;
  _26 = MEM[(unsigned int *)&in + 16B];
  MEM[(unsigned int *)&out + 12B] = _26;
  return 0;

(see - no check anymore)

We generate (with -mcpu=e6500 -m64 -maltivec -mabi=altivec, just to pick one
example)

  <bb 2>:
  vect__2.12_11 = __builtin_altivec_mask_for_load (&MEM[(unsigned int *)&in +
4B]);
  vectp.14_13 = &MEM[(unsigned int *)&in + 4B] & -16B;
  vect__2.15_14 = MEM[(unsigned int *)vectp.14_13];
  vectp.14_16 = &MEM[(void *)&in + 16B] & -16B;
  vect__2.16_17 = MEM[(unsigned int *)vectp.14_16];
  vect__2.17_18 = REALIGN_LOAD <vect__2.15_14, vect__2.16_17, vect__2.12_11>;
  MEM[(unsigned int *)&out] = vect__2.17_18;
  return 0;

and

(insn 16 15 17 (set (subreg:DI (reg:V4SI 171 [ vect__2.15 ]) 8)
        (mem:DI (plus:DI (reg:DI 170)
                (const_int 8 [0x8])) [1 MEM[(unsigned int *)&MEM[(unsigned int
*)&in + 4B] & -16B]+8 S8 A32])) t.c:14 -1
     (nil))

(insn 17 16 18 (set (subreg:DI (reg:V4SI 171 [ vect__2.15 ]) 0)
        (mem:DI (reg:DI 170) [1 MEM[(unsigned int *)&MEM[(unsigned int *)&in +
4B] & -16B]+0 S8 A32])) t.c:14 -1
     (nil))

(insn 21 20 22 (set (reg:V4SI 176)
        (mem:V4SI (reg:DI 174) [1 MEM[(unsigned int *)&MEM[(void *)&in + 16B] &
-16B]+0 S16 A128])) t.c:14 -1
     (nil))

so for some reason we expand the first aligned load using two DI loads.

Investigating.

I have a fix which ends up producing

.L.main1:
        addis 9,2,.LANCHOR0@toc@ha
        li 3,0
        addi 9,9,.LANCHOR0@toc@l
        addi 10,9,4
        addi 9,9,16
        neg 8,10
        lvx 0,0,9
        lvsr 13,0,8
        addis 9,2,.LANCHOR1@toc@ha
        lvx 1,0,10
        addi 9,9,.LANCHOR1@toc@l
        vperm 0,1,0,13
        stvx 0,0,9
        blr

not sure if that is the same as with 4.8 though (don't have a cross ready
to verify - but the RTL looks good).


  parent reply	other threads:[~2015-02-26  9:39 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-63175-4@http.gcc.gnu.org/bugzilla/>
2014-09-05  8:47 ` rguenth at gcc dot gnu.org
2014-10-30 10:42 ` jakub at gcc dot gnu.org
2014-11-24 13:16 ` rguenth at gcc dot gnu.org
2015-02-21 20:07 ` msebor at gcc dot gnu.org
2015-02-22 20:38 ` macro@linux-mips.org
2015-02-24  6:56 ` msebor at gcc dot gnu.org
2015-02-25 20:45 ` msebor at gcc dot gnu.org
2015-02-26 10:19 ` rguenth at gcc dot gnu.org [this message]
2015-02-26 10:56 ` rguenth at gcc dot gnu.org
2015-02-27  9:18 ` rguenth at gcc dot gnu.org
2015-02-27  9:49 ` rguenth at gcc dot gnu.org
2015-02-27 11:23 ` rguenth at gcc dot gnu.org
2015-02-27 11:24 ` rguenth at gcc dot gnu.org
2015-02-28  9:26 ` msebor at gcc dot gnu.org
2015-03-02 14:14 ` rguenth at gcc dot gnu.org
2015-03-02 14:24 ` rguenth at gcc dot gnu.org
2015-03-02 16:24 ` msebor at gcc dot gnu.org
2015-03-02 16:48 ` rguenther at suse dot de
2015-03-02 16:50 ` rguenther at suse dot de
2015-03-02 16:58 ` msebor at gcc dot gnu.org
2015-03-02 17:47 ` rguenther at suse dot de
2015-03-02 18:13 ` msebor at gcc dot gnu.org
2015-03-02 18:23 ` rguenther at suse dot de
2015-03-03  5:10 ` msebor at gcc dot gnu.org
2015-03-03  9:21 ` rguenther at suse dot de
2015-03-03  9:42 ` rguenth at gcc dot gnu.org
2015-03-03 15:05 ` dje at gcc dot gnu.org
2015-03-03 16:19 ` wschmidt at gcc dot gnu.org
2015-03-03 16:22 ` wschmidt at gcc dot gnu.org
2015-03-04  1:15 ` msebor at gcc dot gnu.org
2015-03-04  9:17 ` rguenth at gcc dot gnu.org
2015-03-04 13:42 ` dje at gcc dot gnu.org
2015-03-04 13:55 ` rguenther at suse dot de
2015-03-06 18:44 ` msebor at gcc dot gnu.org
2015-03-07 16:19 ` [Bug testsuite/63175] [4.9 " law at redhat dot com
2015-03-10 21:07 ` msebor at gcc dot gnu.org
2015-03-11 10:09 ` rguenth at gcc dot gnu.org
2015-03-23 18:58 ` msebor at gcc dot gnu.org
2015-05-29 16:49 ` wschmidt at gcc dot gnu.org

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=bug-63175-4-goXUh8Px1j@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).