public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106038] x86_64 vectorization of ALU ops using xmm registers prematurely
Date: Tue, 21 Jun 2022 01:28:40 +0000	[thread overview]
Message-ID: <bug-106038-4-BAvwRv9XQz@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106038-4@http.gcc.gnu.org/bugzilla/>

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

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
vectorizer saw 2 scalar loads + 2 bit_ops + 2 scalar stores vs 1 unaligned_load
+ 1 bit_op + 1 unaligned_store, only scale cost of bit_op doesn't help.

In rtl level, we have

 205(note 3 14 4 2 NOTE_INSN_DELETED)
 206(note 4 3 7 2 NOTE_INSN_FUNCTION_BEG)
 207(insn 7 4 8 2 (set (reg:V2QI 87 [ vect__20.19 ])
 208        (mem:V2QI (reg:DI 91) [0 MEM <const vector(2) unsigned char>
[(const uint8_t *)b_11(D)]+0 S2 A8])) "test.c":31:1 1414 {*movv2qi_internal}
 209     (expr_list:REG_DEAD (reg:DI 91)
 210        (nil)))
 211(insn 8 7 9 2 (set (reg:V2QI 88 [ vect__18.16 ])
 212        (mem:V2QI (reg/v/f:DI 85 [ a ]) [0 MEM <vector(2) unsigned char>
[(uint8_t *)a_10(D)]+0 S2 A8])) "test.c":31:1 1414 {*movv2qi_internal}
 213     (expr_list:REG_EQUIV (mem:V2QI (reg/v/f:DI 85 [ a ]) [0 MEM <vector(2)
unsigned char> [(uint8_t *)a_10(D)]+0 S2 A8])
 214        (nil)))
 215(insn 9 8 10 2 (parallel [
 216            (set (reg:V2QI 89 [ vect__21.20 ])
 217                (xor:V2QI (reg:V2QI 87 [ vect__20.19 ])
 218                    (reg:V2QI 88 [ vect__18.16 ])))
 219            (clobber (reg:CC 17 flags))
 220        ]) "test.c":31:1 1627 {xorv2qi3}
 221     (expr_list:REG_DEAD (reg:V2QI 88 [ vect__18.16 ])
 222        (expr_list:REG_DEAD (reg:V2QI 87 [ vect__20.19 ])
 223            (expr_list:REG_UNUSED (reg:CC 17 flags)
 224                (expr_list:REG_EQUIV (mem:V2QI (reg/v/f:DI 85 [ a ]) [0 MEM
<vector(2) unsigned char> [(uint8_t *)a_10(D)]+0 S2 A8])
 225                    (nil))))))
 226(insn 10 9 0 2 (set (mem:V2QI (reg/v/f:DI 85 [ a ]) [0 MEM <vector(2)
unsigned char> [(uint8_t *)a_10(D)]+0 S2 A8])
 227        (reg:V2QI 89 [ vect__21.20 ])) "test.c":31:1 1414
{*movv2qi_internal}
 228     (expr_list:REG_DEAD (reg:V2QI 89 [ vect__21.20 ])

if RA can allocate 87/88/89 into GPRs, it would same as non-vectorized version.

  parent reply	other threads:[~2022-06-21  1:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 23:49 [Bug target/106038] New: " goldstein.w.n at gmail dot com
2022-06-20 23:53 ` [Bug target/106038] " pinskia at gcc dot gnu.org
2022-06-21  0:01 ` goldstein.w.n at gmail dot com
2022-06-21  1:28 ` crazylht at gmail dot com [this message]
2022-06-21  8:20 ` rguenth at gcc dot gnu.org
2022-06-21 15:33 ` goldstein.w.n at gmail dot com
2022-06-21 15:56 ` crazylht at gmail dot com
2022-07-22  1:39 ` cvs-commit 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-106038-4-BAvwRv9XQz@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).