public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102021] New: Redudant mov instruction for broadcast.
@ 2021-08-23  9:22 crazylht at gmail dot com
  2021-08-23 12:44 ` [Bug target/102021] " hjl.tools at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: crazylht at gmail dot com @ 2021-08-23  9:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102021
           Summary: Redudant mov instruction for broadcast.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-*-* i?86-*-*

#include<immintrin.h>

__m256i
foo ()
{
  return _mm256_set1_epi16 (12);
}


foo():
        movabsq $3377751260921868, %rax
        vpbroadcastq    %rax, %ymm31
        vmovdqa64       %ymm31, %ymm0
        ret

I guess scratch sse register somehow prevent LRA to merge move instructions.

Maybe we should add define_peephole2 for those if we still want to use
ix86_gen_scratch_sse_rtx.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/102021] Redudant mov instruction for broadcast.
  2021-08-23  9:22 [Bug target/102021] New: Redudant mov instruction for broadcast crazylht at gmail dot com
@ 2021-08-23 12:44 ` hjl.tools at gmail dot com
  2021-08-24 12:56 ` cvs-commit at gcc dot gnu.org
  2021-08-24 13:03 ` hjl.tools at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-23 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-23
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Hongtao.liu from comment #0)
> 
> Maybe we should add define_peephole2 for those if we still want to use
> ix86_gen_scratch_sse_rtx.

We should add define_peephole2 since don't use ix86_gen_scratch_sse_rtx will
cause many test failures.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/102021] Redudant mov instruction for broadcast.
  2021-08-23  9:22 [Bug target/102021] New: Redudant mov instruction for broadcast crazylht at gmail dot com
  2021-08-23 12:44 ` [Bug target/102021] " hjl.tools at gmail dot com
@ 2021-08-24 12:56 ` cvs-commit at gcc dot gnu.org
  2021-08-24 13:03 ` hjl.tools at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-24 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:6e5401e87d02919b0594e04f828892deef956407

commit r12-3117-g6e5401e87d02919b0594e04f828892deef956407
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Aug 23 14:47:03 2021 -0700

    x86: Broadcast from integer to a pseudo vector register

    Broadcast from integer to a pseudo vector register instead of a hard
    vector register to allow LRA to remove redundant move instruction after
    broadcast.

    gcc/

            PR target/102021
            * config/i386/i386-expand.c (ix86_expand_vector_move): Broadcast
            from integer to a pseudo vector register.

    gcc/testsuite/

            PR target/102021
            * gcc.target/i386/pr100865-10b.c: Expect vzeroupper.
            * gcc.target/i386/pr100865-4b.c: Likewise.
            * gcc.target/i386/pr100865-6b.c: Expect vmovdqu and vzeroupper.
            * gcc.target/i386/pr100865-7b.c: Likewise.
            * gcc.target/i386/pr102021.c: New test.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/102021] Redudant mov instruction for broadcast.
  2021-08-23  9:22 [Bug target/102021] New: Redudant mov instruction for broadcast crazylht at gmail dot com
  2021-08-23 12:44 ` [Bug target/102021] " hjl.tools at gmail dot com
  2021-08-24 12:56 ` cvs-commit at gcc dot gnu.org
@ 2021-08-24 13:03 ` hjl.tools at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: hjl.tools at gmail dot com @ 2021-08-24 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |12.0

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-24 13:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23  9:22 [Bug target/102021] New: Redudant mov instruction for broadcast crazylht at gmail dot com
2021-08-23 12:44 ` [Bug target/102021] " hjl.tools at gmail dot com
2021-08-24 12:56 ` cvs-commit at gcc dot gnu.org
2021-08-24 13:03 ` hjl.tools at gmail dot com

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).