public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lili.cui at intel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/104723] [12 regression] Redundant usage of stack
Date: Sun, 24 Apr 2022 07:37:38 +0000	[thread overview]
Message-ID: <bug-104723-4-tSlYepSfVl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104723-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from cuilili <lili.cui at intel dot com> ---
(In reply to Jakub Jelinek from comment #10)

> And for the backend, the question is how big the penalty for the overlapping
> store is compared to doing multiple non-overlapping stores.  Say for those
> 49 bytes one could do one OI, one TI/V1TI and one QI load/store as opposed to
> one aligned and one misaligned OI load/store.
> 
> For say:
> void
> foo (void *p, void *q)
> {
>   __builtin_memcpy (p, q, 49);
> }
> we emit the 2 overlapping loads/stores for -mavx512f and 4 non-overlapping
> loads/stores with say -mavx2.

I execute both code sequence 100000 times on ICX and znver3 machines.

For ICX: 2 overlapping loads/stores are 3.5x faster than 4 non-overlapping
loads/stores.
For Znver3: 2 overlapping loads/stores are 1.39x faster than 4 non-overlapping
loads/stores.

------------------------------------
vmovdqu ymm0, YMMWORD PTR [rsi]
vmovdqu YMMWORD PTR [rdi], ymm0
vmovdqu ymm1, YMMWORD PTR [rsi+17]
vmovdqu YMMWORD PTR [rdi+17], ymm1

------------------------------------
vmovdqu xmm0, XMMWORD PTR [rsi]
vmovdqu XMMWORD PTR [rdi], xmm0
vmovdqu xmm1, XMMWORD PTR [rsi+16]
vmovdqu XMMWORD PTR [rdi+16], xmm1
vmovdqu xmm2, XMMWORD PTR [rsi+32]
vmovdqu XMMWORD PTR [rdi+32], xmm2
movzx   eax, BYTE PTR [rsi+48]
mov     BYTE PTR [rdi+48], al
-----------------------------------

  parent reply	other threads:[~2022-04-24  7:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  8:35 [Bug target/104723] New: " crazylht at gmail dot com
2022-03-01  8:44 ` [Bug target/104723] " crazylht at gmail dot com
2022-03-01  8:47 ` crazylht at gmail dot com
2022-03-01 12:38 ` lili.cui at intel dot com
2022-03-01 13:41 ` rguenth at gcc dot gnu.org
2022-03-01 16:00 ` jakub at gcc dot gnu.org
2022-03-01 16:07 ` jakub at gcc dot gnu.org
2022-03-01 18:45 ` hjl.tools at gmail dot com
2022-03-01 18:50 ` hjl.tools at gmail dot com
2022-03-02  8:11 ` lili.cui at intel dot com
2022-04-22 16:28 ` jakub at gcc dot gnu.org
2022-04-24  7:37 ` lili.cui at intel dot com [this message]
2022-04-26  9:41 ` jakub at gcc dot gnu.org
2022-05-06  8:32 ` [Bug target/104723] [12/13 " jakub at gcc dot gnu.org
2022-07-26 12:58 ` rguenth at gcc dot gnu.org
2023-05-08 12:23 ` [Bug target/104723] [12/13/14 " 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-104723-4-tSlYepSfVl@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).