public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves
@ 2022-02-04 18:14 rsandifo at gcc dot gnu.org
  2022-02-04 21:25 ` [Bug rtl-optimization/104387] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2022-02-04 18:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104387
           Summary: aarch64: Redundant SXTH for “bag of bits” moves
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*-*-*

This PR is about another case in which we generate a redundant SXTH.
Specifically:

void f(short *x, short y)
{
  x[0] = y;
  x[1] = y;
}

generates:

        sxth    w1, w1
        strh    w1, [x0]
        strh    w1, [x0, 2]

even though the RTL makes it clear that the upper 16 bits of the
promoted “y” are unused.

This is related to PR64537, but I think it's worth keeping as a
separate PR since the fix isn't necessarily the same.

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

* [Bug rtl-optimization/104387] aarch64: Redundant SXTH for “bag of bits” moves
  2022-02-04 18:14 [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves rsandifo at gcc dot gnu.org
@ 2022-02-04 21:25 ` pinskia at gcc dot gnu.org
  2023-10-31 22:07 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-04 21:25 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-02-04
     Ever confirmed|0                           |1
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=81357,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=95650,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=96031
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, I thought I had saw an dup of this bug before.

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

* [Bug rtl-optimization/104387] aarch64: Redundant SXTH for “bag of bits” moves
  2022-02-04 18:14 [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves rsandifo at gcc dot gnu.org
  2022-02-04 21:25 ` [Bug rtl-optimization/104387] " pinskia at gcc dot gnu.org
@ 2023-10-31 22:07 ` pinskia at gcc dot gnu.org
  2023-10-31 22:09 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31 22:07 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 111835 has been marked as a duplicate of this bug. ***

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

* [Bug rtl-optimization/104387] aarch64: Redundant SXTH for “bag of bits” moves
  2022-02-04 18:14 [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves rsandifo at gcc dot gnu.org
  2022-02-04 21:25 ` [Bug rtl-optimization/104387] " pinskia at gcc dot gnu.org
  2023-10-31 22:07 ` pinskia at gcc dot gnu.org
@ 2023-10-31 22:09 ` pinskia at gcc dot gnu.org
  2023-11-01  6:30 ` lis8215 at gmail dot com
  2023-11-01 13:56 ` law at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31 22:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Some analysis about this is recorded at
https://gcc.gnu.org/bugzilla//show_bug.cgi?id=111835#c1 .

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

* [Bug rtl-optimization/104387] aarch64: Redundant SXTH for “bag of bits” moves
  2022-02-04 18:14 [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves rsandifo at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-10-31 22:09 ` pinskia at gcc dot gnu.org
@ 2023-11-01  6:30 ` lis8215 at gmail dot com
  2023-11-01 13:56 ` law at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: lis8215 at gmail dot com @ 2023-11-01  6:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Siarhei Volkau <lis8215 at gmail dot com> ---
*** Bug 111384 has been marked as a duplicate of this bug. ***

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

* [Bug rtl-optimization/104387] aarch64: Redundant SXTH for “bag of bits” moves
  2022-02-04 18:14 [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves rsandifo at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-11-01  6:30 ` lis8215 at gmail dot com
@ 2023-11-01 13:56 ` law at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: law at gcc dot gnu.org @ 2023-11-01 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
As noted in bz111384, this can be addressed via Joern's extension DCE pass that
we're beating on right now.  Conceptually it tracks liveness of sub-word
objects within a register and when it encounters an extension that sets bits
that are never read, it eliminates the extension. Conceptually simple and we've
confirmed it addresses the issue in 111384.  I strongly suspect it would fix
this one as well.

It's still got bugs and isn't really for integration, but to date Joern's basic
approach seems the most viable for eliminating unnecessary extensions.

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

end of thread, other threads:[~2023-11-01 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 18:14 [Bug rtl-optimization/104387] New: aarch64: Redundant SXTH for “bag of bits” moves rsandifo at gcc dot gnu.org
2022-02-04 21:25 ` [Bug rtl-optimization/104387] " pinskia at gcc dot gnu.org
2023-10-31 22:07 ` pinskia at gcc dot gnu.org
2023-10-31 22:09 ` pinskia at gcc dot gnu.org
2023-11-01  6:30 ` lis8215 at gmail dot com
2023-11-01 13:56 ` law at gcc dot gnu.org

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