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/102494] Failure to optimize vector reduction properly especially when using OpenMP Date: Mon, 27 Sep 2021 08:47:09 +0000 [thread overview] Message-ID: <bug-102494-4-9YXB6HawK3@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102494-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102494 --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- The vectorizer looks for a way to "shift" the whole vector by either vec_shr or a corresponding vec_perm with constant shuffle operands. When the target provides none of those you get element extracts and scalar adds. So yes, the vectorizer does the work for you but only if you hand it the pieces. It could possibly use a larger vector, doing only the "tail" of its final reduction, so try with v8hi instead of v4hi, but it's not really clear if such strategy would be good in general.
next prev parent reply other threads:[~2021-09-27 8:47 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-27 0:52 [Bug tree-optimization/102494] New: Failure to optimize out " gabravier at gmail dot com 2021-09-27 1:45 ` [Bug tree-optimization/102494] " pinskia at gcc dot gnu.org 2021-09-27 3:01 ` crazylht at gmail dot com 2021-09-27 5:08 ` [Bug tree-optimization/102494] Failure to optimize " crazylht at gmail dot com 2021-09-27 5:13 ` crazylht at gmail dot com 2021-09-27 5:55 ` crazylht at gmail dot com 2021-09-27 8:47 ` rguenth at gcc dot gnu.org [this message] 2021-09-28 6:57 ` crazylht at gmail dot com 2021-09-28 7:09 ` rguenther at suse dot de 2021-10-08 2:10 ` cvs-commit at gcc dot gnu.org 2021-10-25 21:44 ` peter at cordes dot ca 2021-10-25 22:00 ` peter at cordes dot ca 2021-10-26 8:13 ` crazylht at gmail dot com
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-102494-4-9YXB6HawK3@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: linkBe 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).