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/61634] [4.8/4.9/5 Regression] ICE in in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1423
Date: Tue, 25 Nov 2014 16:35:00 -0000	[thread overview]
Message-ID: <bug-61634-4-bovoWjQWLV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61634-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue seems that we fail to detect hybrid SLP here because
vect_detect_hybrid_slp_stmts walks immediate uses of SLP defs but those
do not reach pattern stmts but only original ones.  In this case we have

  _11 = *prephitmp_46;
  _12 = _11 >> 2;
  f_13 = (int) _12;
  *prephitmp_46 = _12;
  _17 = f_13 * f_13;

where the SLP def _12 is used in f_13 = (int) _12; but that stmt is marked
as vect_unused_in_scope because it feeds a stmt that was pattern detected
as widening multiplication.  But we never visit that stmt, as its
immediate uses are not accounted for (pattern stmts never get updated).

That makes the vect_detect_hybrid_slp_stmts functions non-functional
for non-trivial patterns.  We can "fix" this by marking the stmts
in some way and make sure to account for them in the loop.  For the
testcase forcing hybrid SLP by making !STMT_VINFO_RELEVANT stmts
force it fixes it.

I think that the best thing to do is to re-write hybrid SLP detection
in terms of walking all stmts in the loop, similar to
vect_mark_stmts_to_be_vectorized and mark pure SLP stmts as hybrid.
The flag then still has to be propagated to the SLP tree children of
such node.

I have a prototype but that still needs quite some TLC.


  parent reply	other threads:[~2014-11-25 16:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 17:36 [Bug c/61634] New: [4.8.3/4.9.1] " manuel.lauss at googlemail dot com
2014-06-28  7:36 ` [Bug tree-optimization/61634] [4.8/4.9/4.10 Regression] " trippels at gcc dot gnu.org
2014-06-30 13:27 ` jakub at gcc dot gnu.org
2014-07-07 11:08 ` rguenth at gcc dot gnu.org
2014-07-08 11:29 ` rguenth at gcc dot gnu.org
2014-11-25 16:35 ` rguenth at gcc dot gnu.org [this message]
2014-11-27  9:34 ` [Bug tree-optimization/61634] [4.8/4.9/5 " rguenth at gcc dot gnu.org
2014-11-27  9:37 ` [Bug tree-optimization/61634] [4.8/4.9 " rguenth at gcc dot gnu.org
2014-12-10 13:01 ` rguenth at gcc dot gnu.org
2014-12-19 13:44 ` jakub at gcc dot gnu.org
2015-02-23 12:38 ` rguenth at gcc dot gnu.org
2015-02-26 14:18 ` [Bug tree-optimization/61634] [4.8 " rguenth at gcc dot gnu.org
2015-02-26 14:39 ` 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-61634-4-bovoWjQWLV@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).