public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/97642] Incorrect replacement of vmovdqu32 with vpblendd can cause fault
Date: Fri, 30 Oct 2020 17:57:08 +0000	[thread overview]
Message-ID: <bug-97642-4-dBtNHKWtmo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97642-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                 CC|                            |crazylht at gmail dot com,
                   |                            |hjl.tools at gmail dot com,
                   |                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2020-10-30
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The problem is that in the RTL representation there is nothing that would tell
cse, forward propagation or combiner etc. not to optimize the
(insn 7 6 8 2 (set (reg:QI 89)
        (const_int 31 [0x1f])) "include/avx512vlintrin.h":865:20 77
{*movqi_internal}
     (nil))
(insn 8 7 9 2 (set (reg:V8SI 87)
        (vec_merge:V8SI (mem:V8SI (reg/v/f:DI 86 [ arr ]) [0  S32 A8])
            (reg:V8SI 88)
            (reg:QI 89))) "include/avx512vlintrin.h":865:20 1423
{avx512vl_loadv8si_mask}
     (nil))
into:
(insn 8 7 9 2 (set (reg:V8SI 87)
        (vec_merge:V8SI (mem:V8SI (reg/v/f:DI 86 [ arr ]) [0  S32 A8])
            (reg:V8SI 88 [ tmp ])
            (const_int 31 [0x1f]))) "include/avx512vlintrin.h":865:20 4402
{avx2_pblenddv8si}
     (expr_list:REG_DEAD (reg:QI 89)
        (expr_list:REG_DEAD (reg:V8SI 88 [ tmp ])
            (expr_list:REG_DEAD (reg/v/f:DI 86 [ arr ])
                (nil)))))
Guess we'd need to use some UNSPEC for the masked loads and have patterns for
combine to optimize those that have -1 masks into normal loads, or disable the
blend patterns with MEM operands for avx512f+ (i.e. force those into
registers).
Because the RTL representation really matches more the blend behavior than the
avx512 masking, where exceptions from the masked off elts just don't show up.

  reply	other threads:[~2020-10-30 17:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 16:33 [Bug c++/97642] New: " goldstein.w.n at gmail dot com
2020-10-30 17:57 ` jakub at gcc dot gnu.org [this message]
2020-10-30 17:57 ` [Bug c++/97642] " jakub at gcc dot gnu.org
2020-11-03  7:46 ` [Bug target/97642] " crazylht at gmail dot com
2020-11-03  9:03 ` jakub at gcc dot gnu.org
2020-12-03  5:34 ` cvs-commit at gcc dot gnu.org
2020-12-03  5:40 ` crazylht at gmail dot com
2023-01-30 19:10 ` 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-97642-4-dBtNHKWtmo@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).