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 tree-optimization/66142] Loop is not vectorized because not sufficient support for GOMP_SIMD_LANE
Date: Wed, 27 May 2015 07:56:00 -0000	[thread overview]
Message-ID: <bug-66142-4-9T6f4ktgHB@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66142-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
As said in comment #9, this is PR63916 I think.  We have

  _9 = &D.3665[_11].org;
  MEM[(struct vec_ *)_9] = 1.0e+0;
  MEM[(struct vec_ *)_9 + 4B] = _8;
...
  _24 = MEM[(const struct Ray *)&D.3665][_11].org.x;
  _27 = MEM[(const struct Ray *)&D.3665][_11].org.y;

which ultimately is from inlining of

  D.3665[D.3663].org = p;
  D.3665[D.3663].dir.x = x;
  D.3665[D.3663].dir.y = y;
  D.3664[D.3663].t = 1.0e+10;
  D.3664[D.3663].h = 0;
  D.3667 = &D.3665[D.3663];
  D.3668 = &D.3664[D.3663];
  bar (D.3668, D.3667, &spheres[0]);

to

  p.x = 1.0e+0;  
  p.y = _9;
...
  D.3665[_15].org = p;
  D.3665[_15].dir.x = x_16;
  D.3665[_15].dir.y = y_17;
  D.3664[_15].t = 1.0e+10;
  D.3664[_15].h = 0;
  _23 = &D.3665[_15];
  _24 = &D.3664[_15];
  _32 = MEM[(const struct Ray *)_23].org.x;

forwprop cannot forward &D.3665[_15] into the dereference (it would create
a bogus access paths even if types were matching and TBAA would be fine).
And SCCVN isn't able to "canonicalize" the accesses (because it doesn't
look at stmt defs when building the canonical address of an access).
Note that PRE uses the canonical form for expression insertion so we have
to be careful what we put in the canonical form (or separate the address
compute from the actual dereference).

Yes, lowering the access more in the SCCVN machinery would be possible
(say, use the affine combination machinery with the powers of
affine-comb-expand (and making that use the VN lattice...)), but the
issue with this is always PRE insertion and us _not_ wanting to have
all PRE inserted loads be fully lowered to address-compute plus indirection.

I hope to get to PR63916 this stage1.


  parent reply	other threads:[~2015-05-27  7:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 14:18 [Bug tree-optimization/66142] New: " ysrumyan at gmail dot com
2015-05-14 14:19 ` [Bug tree-optimization/66142] " ysrumyan at gmail dot com
2015-05-22 10:09 ` jakub at gcc dot gnu.org
2015-05-22 11:12 ` jakub at gcc dot gnu.org
2015-05-22 11:40 ` jakub at gcc dot gnu.org
2015-05-22 11:54 ` jakub at gcc dot gnu.org
2015-05-22 14:51 ` jakub at gcc dot gnu.org
2015-05-25  9:35 ` jakub at gcc dot gnu.org
2015-05-25 12:48 ` jakub at gcc dot gnu.org
2015-05-26  8:28 ` rguenther at suse dot de
2015-05-26  8:42 ` rguenth at gcc dot gnu.org
2015-05-26 13:56 ` rguenth at gcc dot gnu.org
2015-05-26 14:43 ` rguenth at gcc dot gnu.org
2015-05-27  7:56 ` rguenth at gcc dot gnu.org [this message]
2015-05-28 13:25 ` rguenth at gcc dot gnu.org
2015-05-29 13:07 ` jakub at gcc dot gnu.org
2015-06-02 13:18 ` rguenth at gcc dot gnu.org
2015-06-02 13:34 ` rguenth at gcc dot gnu.org
2015-06-03  8:03 ` rguenth at gcc dot gnu.org
2015-09-14 14:10 ` rguenth at gcc dot gnu.org
2015-09-17 12:36 ` rguenth at gcc dot gnu.org
2015-09-18  7:57 ` rguenth at gcc dot gnu.org
2021-05-04 13:17 ` rguenth 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-66142-4-9T6f4ktgHB@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).