public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ebiggers3 at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/107892] Unnecessary move between ymm registers in loop using AVX2 intrinsic Date: Mon, 28 Nov 2022 08:15:40 +0000 [thread overview] Message-ID: <bug-107892-4-IEvxLqhgrW@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-107892-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107892 --- Comment #1 from Eric Biggers <ebiggers3 at gmail dot com> --- The reproducer I gave in my first comment doesn't reproduce the bug on releases/gcc-11.1.0, so it must have regressed between then and trunk. I can do a bisection if needed. However, I actually still see the bug with gcc-11.1.0 on my original unminimized code at https://github.com/ebiggers/libdeflate/blob/fb0c43373f6fe600471457f4c021b8ad7e4bbabf/lib/x86/adler32_impl.h#L142. So maybe the reproducer I gave is not the best one. Here is a slightly different reproducer that reproduces the bug with both gcc-11.1.0 and trunk: #include <immintrin.h> __m256i __attribute__((target("avx2"))) f(const __m256i *p, size_t n) { __m256i a = _mm256_setzero_si256(); do { a = _mm256_add_epi32(a, *p++); } while (--n); return _mm256_madd_epi16(a, a); } The assembly of the loop has the unnecessary vmovdqa: 8: c5 f5 fe 07 vpaddd (%rdi),%ymm1,%ymm0 c: 48 83 c7 20 add $0x20,%rdi 10: c5 fd 6f c8 vmovdqa %ymm0,%ymm1 14: 48 83 ee 01 sub $0x1,%rsi 18: 75 ee jne 8 <f+0x8>
next prev parent reply other threads:[~2022-11-28 8:15 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-28 7:41 [Bug rtl-optimization/107892] New: " ebiggers3 at gmail dot com 2022-11-28 8:15 ` ebiggers3 at gmail dot com [this message] 2022-11-28 8:23 ` [Bug rtl-optimization/107892] " ebiggers3 at gmail dot com 2022-11-28 8:43 ` crazylht at gmail dot com
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-107892-4-IEvxLqhgrW@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: linkBe 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).