public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106022] [12/13 Regression] Enable vectorizer generates extra load
Date: Sun, 03 Jul 2022 17:30:51 +0000	[thread overview]
Message-ID: <bug-106022-4-kN8Fgs5DKE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106022-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:f3a5e75cb66dc96efca7d494fe6060746c88acb1

commit r13-1415-gf3a5e75cb66dc96efca7d494fe6060746c88acb1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jun 17 17:02:05 2022 -0700

    x86: Support 2/4/8 byte constant vector stores

    1. Add a predicate for constant vectors which can be converted to integer
    constants suitable for constant integer stores.  For a 8-byte constant
    vector, the converted 64-bit integer must be valid for store with 64-bit
    immediate, which is a 64-bit integer sign-extended from a 32-bit integer.
    2. Add a new pattern to allow 2-byte, 4-byte and 8-byte constant vector
    stores, like

    (set (mem:V2HI (reg:DI 84))
         (const_vector:V2HI [(const_int 0 [0]) (const_int 1 [0x1])]))

    3. After reload, convert constant vector stores to constant integer
    stores, like

    (set (mem:SI (reg:DI 5 di [84]))
         (const_int 65536 [0x10000]))

    For

    void
    foo (short * c)
    {
      c[0] = 0;
      c[1] = 1;
    }

    it generates

            movl    $65536, (%rdi)

    instead of

            movl    .LC0(%rip), %eax
            movl    %eax, (%rdi)

    gcc/

            PR target/106022
            * config/i386/i386-protos.h (ix86_convert_const_vector_to_integer):
            New.
            * config/i386/i386.cc (ix86_convert_const_vector_to_integer):
            New.
            * config/i386/mmx.md (V_16_32_64): New.
            (*mov<mode>_imm): New patterns for stores with 16-bit, 32-bit
            and 64-bit constant vector.
            * config/i386/predicates.md (x86_64_const_vector_operand): New.

    gcc/testsuite/

            PR target/106022
            * gcc.target/i386/pr106022-1.c: New test.
            * gcc.target/i386/pr106022-2.c: Likewise.
            * gcc.target/i386/pr106022-3.c: Likewise.
            * gcc.target/i386/pr106022-4.c: Likewise.

  parent reply	other threads:[~2022-07-03 17:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-17 21:59 [Bug target/106022] New: " hjl.tools at gmail dot com
2022-06-17 23:18 ` [Bug target/106022] " hjl.tools at gmail dot com
2022-06-20  2:07 ` crazylht at gmail dot com
2022-06-20 11:23 ` rguenth at gcc dot gnu.org
2022-06-20 11:24 ` rguenth at gcc dot gnu.org
2022-06-20 12:42 ` crazylht at gmail dot com
2022-06-20 14:07 ` hjl.tools at gmail dot com
2022-06-20 16:35 ` hjl.tools at gmail dot com
2022-06-21  6:41 ` rguenth at gcc dot gnu.org
2022-06-21 14:39 ` hjl.tools at gmail dot com
2022-06-21 22:23 ` hjl.tools at gmail dot com
2022-06-23  6:19 ` rguenth at gcc dot gnu.org
2022-06-24 21:22 ` hjl.tools at gmail dot com
2022-06-27  9:00 ` rguenther at suse dot de
2022-06-27 13:33 ` hjl.tools at gmail dot com
2022-06-28  6:44 ` rguenther at suse dot de
2022-06-29 21:53 ` hjl.tools at gmail dot com
2022-06-30  3:48 ` crazylht at gmail dot com
2022-07-03 17:30 ` cvs-commit at gcc dot gnu.org [this message]
2022-07-25 15:57 ` [Bug target/106022] [12 " rguenth at gcc dot gnu.org
2022-07-27  7:26 ` rguenth at gcc dot gnu.org
2023-01-18  9:57 ` jakub at gcc dot gnu.org
2023-05-08 12:24 ` 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-106022-4-kN8Fgs5DKE@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).