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/95845] Failure to optimize vector load made in separate operations to single load
Date: Thu, 02 Sep 2021 07:01:43 +0000	[thread overview]
Message-ID: <bug-95845-4-ZRB6DaiGTe@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95845-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
It's now vectorized at -O3 or with -ftree-slp-vectorize.  In particular
vect_slp_check_for_constructors now matches

      else if (code == BIT_INSERT_EXPR
               && VECTOR_TYPE_P (TREE_TYPE (rhs))
               && TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)).is_constant ()
               && TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)).to_constant () > 1
               && integer_zerop (gimple_assign_rhs3 (assign))
               && useless_type_conversion_p
                    (TREE_TYPE (TREE_TYPE (rhs)),
                     TREE_TYPE (gimple_assign_rhs2 (assign)))
               && bb_vinfo->lookup_def (gimple_assign_rhs2 (assign)))
        {
          /* We start to match on insert to lane zero but since the
             inserts need not be ordered we'd have to search both
             the def and the use chains.  */

this matching could be factored out and used by forwprop to build a
vector CTOR.  So I don't think it's fully fixed yet and there's an
opportunity to improve things earlier.

Partial defs of otherwise uninitialized vectors might also be an interesting
target.  When not keying on lane zero to start the match the possibility
is to start matching on the insert that does not have a single immediate
use of the result in another BIT_INSERT_EXPR.

  parent reply	other threads:[~2021-09-02  7:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 15:43 [Bug tree-optimization/95845] New: " gabravier at gmail dot com
2020-06-24  6:51 ` [Bug tree-optimization/95845] " rguenth at gcc dot gnu.org
2021-09-01 23:29 ` gabravier at gmail dot com
2021-09-02  7:01 ` rguenth at gcc dot gnu.org [this message]
2023-05-12  6:23 ` 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-95845-4-ZRB6DaiGTe@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).