public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "liuhongt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/112579] bb vectorizer failed to reduction sum += inv >> {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
Date: Fri, 17 Nov 2023 05:43:30 +0000	[thread overview]
Message-ID: <bug-112579-4-Dt35gmvf7V@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112579-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from liuhongt at gcc dot gnu.org ---
Got vectorized after change source code to

unsigned
foo (unsigned * restrict s, unsigned qh, unsigned * restrict qs) {
  unsigned int sumi = 0;

  sumi += (qh >> 16);
  sumi += (qh >> 1);
  sumi += (qh >> 2);
  sumi += (qh >> 3);
  sumi += (qh >> 4);
  sumi += (qh >> 5);
  sumi += (qh >> 6);
  sumi += (qh >> 7);
  sumi += (qh >> 8);
  sumi += (qh >> 9);
  sumi += (qh >> 10);
  sumi += (qh >> 11);
  sumi += (qh >> 12);
  sumi += (qh >> 13);
  sumi += (qh >> 14);
  sumi += (qh >> 15);
  return sumi;
}

  parent reply	other threads:[~2023-11-17  5:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  2:57 [Bug tree-optimization/112579] New: bb vectorizer failed to reduction sum += inv >> {1,2,3,4,5,6,7,8} liuhongt at gcc dot gnu.org
2023-11-17  5:41 ` [Bug tree-optimization/112579] " liuhongt at gcc dot gnu.org
2023-11-17  5:43 ` liuhongt at gcc dot gnu.org [this message]
2023-11-17  6:02 ` [Bug tree-optimization/112579] bb vectorizer failed to reduction sum += inv >> {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} liuhongt at gcc dot gnu.org
2023-11-17  6:12 ` liuhongt at gcc dot gnu.org
2023-11-17  6:18 ` pinskia at gcc dot gnu.org
2023-11-17  6:19 ` pinskia 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-112579-4-Dt35gmvf7V@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).